|
Blender V4.5
|
#include "MEM_guardedalloc.h"#include "BLI_math_base.h"#include "BLI_string.h"#include "BLI_utildefines.h"#include "GPU_capabilities.hh"#include "GPU_texture.hh"#include "gpu_backend.hh"#include "gpu_context_private.hh"#include "gpu_texture_private.hh"#include "gpu_framebuffer_private.hh"Go to the source code of this file.
Classes | |
| struct | GPUOffScreen |
Namespaces | |
| namespace | blender |
| namespace | blender::gpu |
Functions | |
C-API | |
| GPUFrameBuffer * | GPU_framebuffer_create (const char *name) |
| void | GPU_framebuffer_free (GPUFrameBuffer *fb) |
| const char * | GPU_framebuffer_get_name (GPUFrameBuffer *fb) |
| void | GPU_framebuffer_bind (GPUFrameBuffer *fb) |
| void | GPU_framebuffer_bind_loadstore (GPUFrameBuffer *fb, const GPULoadStore *load_store_actions, uint actions_len) |
| void | GPU_framebuffer_subpass_transition_array (GPUFrameBuffer *fb, const GPUAttachmentState *attachment_states, uint attachment_len) |
| void | GPU_framebuffer_bind_no_srgb (GPUFrameBuffer *fb) |
| void | GPU_backbuffer_bind (eGPUBackBuffer back_buffer_type) |
| void | GPU_framebuffer_restore () |
| GPUFrameBuffer * | GPU_framebuffer_active_get () |
| GPUFrameBuffer * | GPU_framebuffer_back_get () |
| bool | GPU_framebuffer_bound (GPUFrameBuffer *gpu_fb) |
| bool | GPU_framebuffer_check_valid (GPUFrameBuffer *gpu_fb, char err_out[256]) |
| static void | gpu_framebuffer_texture_attach_ex (GPUFrameBuffer *gpu_fb, GPUAttachment attachment, int slot) |
| void | GPU_framebuffer_texture_attach (GPUFrameBuffer *fb, GPUTexture *tex, int slot, int mip) |
| void | GPU_framebuffer_texture_layer_attach (GPUFrameBuffer *fb, GPUTexture *tex, int slot, int layer, int mip) |
| void | GPU_framebuffer_texture_cubeface_attach (GPUFrameBuffer *fb, GPUTexture *tex, int slot, int face, int mip) |
| void | GPU_framebuffer_texture_detach (GPUFrameBuffer *fb, GPUTexture *tex) |
| void | GPU_framebuffer_config_array (GPUFrameBuffer *gpu_fb, const GPUAttachment *config, int config_len) |
| void | GPU_framebuffer_default_size (GPUFrameBuffer *gpu_fb, int width, int height) |
| void | GPU_framebuffer_viewport_set (GPUFrameBuffer *gpu_fb, int x, int y, int width, int height) |
| void | GPU_framebuffer_multi_viewports_set (GPUFrameBuffer *gpu_fb, const int viewport_rects[GPU_MAX_VIEWPORTS][4]) |
| void | GPU_framebuffer_viewport_get (GPUFrameBuffer *gpu_fb, int r_viewport[4]) |
| void | GPU_framebuffer_viewport_reset (GPUFrameBuffer *gpu_fb) |
| void | GPU_framebuffer_clear (GPUFrameBuffer *gpu_fb, eGPUFrameBufferBits buffers, const float clear_col[4], float clear_depth, uint clear_stencil) |
| void | GPU_framebuffer_clear_color (GPUFrameBuffer *fb, const float clear_col[4]) |
| void | GPU_framebuffer_clear_depth (GPUFrameBuffer *fb, float clear_depth) |
| void | GPU_framebuffer_clear_color_depth (GPUFrameBuffer *fb, const float clear_col[4], float clear_depth) |
| void | GPU_framebuffer_clear_stencil (GPUFrameBuffer *fb, uint clear_stencil) |
| void | GPU_framebuffer_clear_depth_stencil (GPUFrameBuffer *fb, float clear_depth, uint clear_stencil) |
| void | GPU_framebuffer_clear_color_depth_stencil (GPUFrameBuffer *fb, const float clear_col[4], float clear_depth, uint clear_stencil) |
| void | GPU_framebuffer_multi_clear (GPUFrameBuffer *fb, const float(*clear_colors)[4]) |
| void | GPU_clear_color (float red, float green, float blue, float alpha) |
| void | GPU_clear_depth (float depth) |
| void | GPU_framebuffer_read_depth (GPUFrameBuffer *fb, int x, int y, int w, int h, eGPUDataFormat format, void *data) |
| void | GPU_framebuffer_read_color (GPUFrameBuffer *fb, int x, int y, int w, int h, int channels, int slot, eGPUDataFormat format, void *data) |
| void | GPU_frontbuffer_read_color (int x, int y, int w, int h, int channels, eGPUDataFormat format, void *data) |
| void | GPU_framebuffer_blit (GPUFrameBuffer *gpu_fb_read, int read_slot, GPUFrameBuffer *gpu_fb_write, int write_slot, eGPUFrameBufferBits blit_buffers) |
| void | GPU_framebuffer_recursive_downsample (GPUFrameBuffer *fb, int max_level, void(*per_level_callback)(void *user_data, int level), void *user_data) |
| void ** | GPU_framebuffer_py_reference_get (GPUFrameBuffer *fb) |
| void | GPU_framebuffer_py_reference_set (GPUFrameBuffer *fb, void **py_ref) |
GPUOffScreen | |
Container that holds a frame-buffer and its textures. Might be bound to multiple contexts. | |
| static GPUFrameBuffer * | gpu_offscreen_fb_get (GPUOffScreen *ofs) |
| GPUOffScreen * | GPU_offscreen_create (int width, int height, bool with_depth_buffer, eGPUTextureFormat format, eGPUTextureUsage usage, bool clear, char err_out[256]) |
| void | GPU_offscreen_free (GPUOffScreen *offscreen) |
| void | GPU_offscreen_bind (GPUOffScreen *offscreen, bool save) |
| void | GPU_offscreen_unbind (GPUOffScreen *, bool restore) |
| void | GPU_offscreen_draw_to_screen (GPUOffScreen *offscreen, int x, int y) |
| void | GPU_offscreen_read_color_region (GPUOffScreen *offscreen, eGPUDataFormat format, int x, int y, int w, int h, void *r_data) |
| void | GPU_offscreen_read_color (GPUOffScreen *offscreen, eGPUDataFormat format, void *r_data) |
| int | GPU_offscreen_width (const GPUOffScreen *offscreen) |
| int | GPU_offscreen_height (const GPUOffScreen *offscreen) |
| GPUTexture * | GPU_offscreen_color_texture (const GPUOffScreen *offscreen) |
| eGPUTextureFormat | GPU_offscreen_format (const GPUOffScreen *offscreen) |
| void | GPU_offscreen_viewport_data_get (GPUOffScreen *offscreen, GPUFrameBuffer **r_fb, GPUTexture **r_color, GPUTexture **r_depth) |
Frame-Buffer Stack | |
Keeps track of frame-buffer binding operation to restore previously bound frame-buffers. | |
| #define | FRAMEBUFFER_STACK_DEPTH 16 |
| struct { | |
| GPUFrameBuffer * framebuffers [FRAMEBUFFER_STACK_DEPTH] | |
| uint top | |
| } | FrameBufferStack = {{nullptr}} |
| void | GPU_framebuffer_push (GPUFrameBuffer *fb) |
| GPUFrameBuffer * | GPU_framebuffer_pop () |
| uint | GPU_framebuffer_stack_level_get () |
| #define FRAMEBUFFER_STACK_DEPTH 16 |
Definition at line 638 of file gpu_framebuffer.cc.
Referenced by GPU_framebuffer_push().
| void GPU_backbuffer_bind | ( | eGPUBackBuffer | back_buffer_type | ) |
Binds the active context's window frame-buffer. Note that GPU_BACKBUFFER_RIGHT is only available if the window was created using stereo-view.
Definition at line 329 of file gpu_framebuffer.cc.
References blender::gpu::Context::back_left, blender::gpu::Context::back_right, blender::gpu::FrameBuffer::bind(), blender::gpu::Context::get(), and GPU_BACKBUFFER_LEFT.
Referenced by wm_draw_window().
| void GPU_clear_color | ( | float | red, |
| float | green, | ||
| float | blue, | ||
| float | alpha ) |
Clear all color attachment textures of the active frame-buffer with the given red, green, blue, alpha values.
Definition at line 522 of file gpu_framebuffer.cc.
References blender::gpu::Context::active_fb, BLI_assert_msg, blender::gpu::FrameBuffer::clear(), blender::gpu::Context::get(), and GPU_COLOR_BIT.
Referenced by blender::ed::space_node::draw_background_color(), DRW_draw_render_loop_offscreen(), ED_region_clear(), hud_region_draw(), blender::ed::greasepencil::image_render::image_render_begin(), playanim_toscreen_ex(), region_clear_fully_transparent(), region_draw_status_text(), screen_opengl_render_doit(), UI_ThemeClearColor(), wm_draw_window_offscreen(), wm_draw_window_onscreen(), wm_main_playanim_intern(), and wm_window_ghostwindow_add().
| void GPU_clear_depth | ( | float | depth | ) |
Clear the depth attachment texture of the active frame-buffer with the given depth value.
Definition at line 531 of file gpu_framebuffer.cc.
References blender::gpu::Context::active_fb, BLI_assert_msg, blender::gpu::FrameBuffer::clear(), blender::gpu::Context::get(), and GPU_DEPTH_BIT.
Referenced by gpu_select_pick_begin(), gpu_select_pick_load_id(), gpu_select_query_begin(), blender::ed::greasepencil::image_render::image_render_begin(), screen_opengl_render_doit(), and wm_xr_draw_view().
| GPUFrameBuffer * GPU_framebuffer_active_get | ( | ) |
Returns the current context active framebuffer. Return nullptr if no context is active.
Definition at line 346 of file gpu_framebuffer.cc.
References blender::gpu::Context::active_fb, blender::gpu::Context::get(), and blender::gpu::wrap().
Referenced by blender::gpu::GLTexture::clear(), blender::gpu::MTLTexture::clear(), blender::ed::space_node::draw_nodespace_back_pix(), drw_draw_render_loop_2d(), drw_draw_render_loop_3d(), ED_region_do_draw(), ED_view3d_draw_offscreen_imbuf(), blender::draw::command::Clear::execute(), blender::draw::command::ClearMulti::execute(), blender::draw::command::SubPassTransition::execute(), GPU_framebuffer_bound(), GPU_offscreen_bind(), gpu_select_pick_load_id(), pygpu_framebuffer_stack_push_and_bind_or_error(), pygpu_state_active_framebuffer_get(), blender::render::hydra::ViewportEngine::render(), blender::ed::vse::sequencer_ibuf_get(), blender::eevee::ShadowModule::set_view(), wm_surface_make_drawable(), wm_surface_reset_drawable(), WM_system_gpu_context_activate(), WM_system_gpu_context_create(), WM_system_gpu_context_dispose(), WM_system_gpu_context_release(), wm_window_make_drawable(), wm_window_reset_drawable(), and wm_xr_session_surface_draw().
| GPUFrameBuffer * GPU_framebuffer_back_get | ( | ) |
Returns the default (back-left) frame-buffer. It will always exists even if it's just a dummy. Return nullptr if no context is active.
Definition at line 352 of file gpu_framebuffer.cc.
References blender::gpu::Context::back_left, blender::gpu::Context::get(), and blender::gpu::wrap().
Referenced by drw_draw_render_loop_2d(), drw_draw_render_loop_3d(), wm_surface_make_drawable(), wm_surface_reset_drawable(), WM_system_gpu_context_activate(), WM_system_gpu_context_create(), WM_system_gpu_context_dispose(), WM_system_gpu_context_release(), wm_window_make_drawable(), and wm_window_reset_drawable().
| void GPU_framebuffer_bind | ( | GPUFrameBuffer * | fb | ) |
Binds a #GPUFrameBuffer making it the active framebuffer for all geometry rendering.
Definition at line 294 of file gpu_framebuffer.cc.
References fb(), and blender::gpu::unwrap().
Referenced by blender::eevee::Film::accumulate(), blender::draw::gpencil::Instance::antialiasing_accumulate(), blender::draw::edit_select::Instance::begin_sync(), blender::draw::Framebuffer::bind(), blender::eevee::GBuffer::bind(), blender::render::hydra::GPURenderTaskDelegate::bind(), blender::gpu::GLTexture::clear(), blender::gpu::MTLTexture::clear(), blender::eevee::DeferredPipeline::debug_draw(), blender::eevee::HiZBuffer::debug_draw(), blender::eevee::LightModule::debug_draw(), blender::eevee::ShadowModule::debug_draw(), blender::eevee::Film::display(), blender::eevee::LookdevModule::display(), blender::draw::edit_select::Instance::draw(), blender::draw::gpencil::Instance::draw(), blender::draw::overlay::Facing::draw(), blender::draw::overlay::Fade::draw(), blender::draw::overlay::MeshUVs::draw(), blender::draw::overlay::ModeTransfer::draw(), blender::draw::overlay::Paints::draw(), blender::draw::overlay::Particles::draw(), blender::draw::overlay::Text::draw(), blender::draw::overlay::Cameras::draw_background_images(), blender::draw::overlay::Empties::draw_background_images(), blender::draw::overlay::Curves::draw_color_only(), blender::draw::overlay::GreasePencil::draw_color_only(), blender::draw::overlay::Grid::draw_color_only(), blender::draw::overlay::LightProbes::draw_color_only(), blender::draw::overlay::Meshes::draw_color_only(), blender::draw::overlay::MotionPath::draw_color_only(), blender::draw::overlay::Origins::draw_color_only(), blender::draw::overlay::XrayFade::draw_color_only(), blender::draw::overlay::Empties::draw_images(), blender::draw::overlay::Cameras::draw_in_front(), blender::draw::overlay::Empties::draw_in_front_images(), blender::draw::overlay::Armatures::draw_line(), blender::draw::overlay::AttributeViewer::draw_line(), blender::draw::overlay::Axes::draw_line(), blender::draw::overlay::Bounds::draw_line(), blender::draw::overlay::Cameras::draw_line(), blender::draw::overlay::Curves::draw_line(), blender::draw::overlay::Empties::draw_line(), blender::draw::overlay::Fluids::draw_line(), blender::draw::overlay::ForceFields::draw_line(), blender::draw::overlay::GreasePencil::draw_line(), blender::draw::overlay::Lattices::draw_line(), blender::draw::overlay::LightProbes::draw_line(), blender::draw::overlay::Lights::draw_line(), blender::draw::overlay::Meshes::draw_line(), blender::draw::overlay::Metaballs::draw_line(), blender::draw::overlay::Particles::draw_line(), blender::draw::overlay::PointClouds::draw_line(), blender::draw::overlay::Prepass::draw_line(), blender::draw::overlay::Relations::draw_line(), blender::draw::overlay::Sculpts::draw_line(), blender::draw::overlay::Speakers::draw_line(), blender::draw::overlay::Wireframe::draw_line(), blender::draw::overlay::Outline::draw_line_only_ex(), blender::draw::overlay::ImagePrepass::draw_on_render(), blender::draw::overlay::MeshUVs::draw_on_render(), blender::draw::overlay::Sculpts::draw_on_render(), blender::draw::overlay::Cursor::draw_output(), blender::ed::vse::draw_registered_callbacks(), blender::draw::overlay::Cameras::draw_scene_background_images(), blender::ed::vse::draw_timeline_post_view_callbacks(), blender::ed::vse::draw_timeline_pre_view_callbacks(), blender::image_engine::ScreenSpaceDrawingMode::draw_viewport(), drw_callbacks_post_scene(), drw_callbacks_post_scene_2D(), DRW_draw_depth_loop(), drw_draw_render_loop_2d(), drw_draw_render_loop_3d(), DRW_draw_select_loop(), DRW_select_buffer_read(), ED_region_do_draw(), ED_view3d_draw_offscreen_imbuf(), blender::draw::command::FramebufferBind::execute(), gizmo_find_intersected_3d(), GPU_offscreen_create(), GPU_offscreen_unbind(), blender::gpu::tests::gpu_shader_lib_test(), GPU_viewport_stereo_composite(), blender::ed::vse::preview_draw_color_render_begin(), pygpu_framebuffer_stack_pop_and_restore_or_error(), pygpu_framebuffer_stack_push_and_bind_or_error(), blender::eevee::BackgroundPipeline::render(), blender::eevee::DeferredLayer::render(), blender::eevee::DeferredProbePipeline::render(), blender::eevee::DepthOfField::render(), blender::eevee::PlanarProbePipeline::render(), blender::eevee::ShadingView::render(), blender::render::hydra::ViewportEngine::render(), blender::draw::gpencil::render_init_buffers(), blender::eevee::CaptureView::render_probes(), blender::draw::gpencil::render_result_combined(), blender::draw::gpencil::render_result_separated_pass(), blender::eevee::CaptureView::render_world(), blender::ed::vse::sequencer_ibuf_get(), blender::eevee::ShadowModule::set_view(), blender::gpu::tests::test_framebuffer_clear_color_multiple_attachments(), blender::gpu::tests::test_framebuffer_clear_color_single_attachment(), blender::gpu::tests::test_framebuffer_clear_depth(), blender::gpu::tests::test_framebuffer_clear_multiple_color_multiple_attachments(), blender::gpu::tests::test_framebuffer_cube(), blender::gpu::tests::test_framebuffer_multi_viewport(), blender::gpu::tests::test_framebuffer_scissor_test(), blender::gpu::tests::test_framebuffer_subpass_input(), blender::gpu::tests::ShaderSpecializationConst::validate(), view3d_gpu_read_Z_pixels(), write_render_color_output(), and write_render_z_output().
| void GPU_framebuffer_bind_loadstore | ( | GPUFrameBuffer * | fb, |
| const GPULoadStore * | load_store_actions, | ||
| uint | load_store_actions_len ) |
Load store config array (load_store_actions) matches attachment structure of GPU_framebuffer_config_array. This allows us to explicitly specify whether attachment data needs to be loaded and stored on a per-attachment basis. This enables a number of bandwidth optimizations:
NOTE: Using GPU_framebuffer_clear_* functions in conjunction with a custom load-store configuration is invalid. Instead, utilize GPU_LOADACTION_CLEAR and provide a clear color as the third parameter in GPULoadStore action.
For Color attachments: {GPU_LOADACTION_CLEAR, GPU_STOREACTION_STORE, {Rf, Gf, Bf, Af}} For Depth attachments: {GPU_LOADACTION_CLEAR, GPU_STOREACTION_STORE, {Df}}
Example:
Definition at line 302 of file gpu_framebuffer.cc.
References fb(), and blender::gpu::unwrap().
| void GPU_framebuffer_bind_no_srgb | ( | GPUFrameBuffer * | fb | ) |
Same as GPU_framebuffer_bind but do not enable the SRGB transform.
Definition at line 323 of file gpu_framebuffer.cc.
References fb(), and blender::gpu::unwrap().
Referenced by blender::ed::space_node::draw_nodespace_back_pix(), blender::ed::vse::draw_registered_callbacks(), blender::ed::vse::draw_timeline_post_view_callbacks(), blender::ed::vse::draw_timeline_pre_view_callbacks(), blender::ed::space_node::node_draw_space(), blender::ed::vse::preview_draw_overlay_begin(), and blender::ed::vse::sequencer_preview_draw_empty().
| void GPU_framebuffer_blit | ( | GPUFrameBuffer * | fb_read, |
| int | read_slot, | ||
| GPUFrameBuffer * | fb_write, | ||
| int | write_slot, | ||
| eGPUFrameBufferBits | blit_buffers ) |
Copy the content of fb_read attachments to the fb_read attachments. The attachments types are chosen by blit_buffers . Only one color buffer can by copied at a time and its index is chosen by read_slot and write_slot. The source and destination frame-buffers dimensions have to match. DEPRECATED: Prefer using GPU_texture_copy().
Definition at line 569 of file gpu_framebuffer.cc.
References blender::gpu::Context::active_fb, blender::gpu::FrameBuffer::bind(), BLI_assert, blender::gpu::FrameBuffer::blit_to(), blender::gpu::FrameBuffer::color_tex(), blender::gpu::FrameBuffer::depth_tex(), blender::gpu::Context::get(), GPU_DEPTH_BIT, GPU_STENCIL_BIT, GPU_texture_format(), GPU_texture_has_depth_format(), GPU_texture_has_stencil_format(), and blender::gpu::unwrap().
| bool GPU_framebuffer_bound | ( | GPUFrameBuffer * | fb | ) |
Return true if framebuffer is the active framebuffer of the active context.
Definition at line 358 of file gpu_framebuffer.cc.
References GPU_framebuffer_active_get().
Referenced by pygpu_framebuffer_clear(), pygpu_framebuffer_is_bound(), and pygpu_framebuffer_stack_pop_and_restore_or_error().
| bool GPU_framebuffer_check_valid | ( | GPUFrameBuffer * | fb, |
| char | err_out[256] ) |
Checks a framebuffer current configuration for errors. Checks for texture size mismatch, incompatible attachment, incomplete textures etc...
Definition at line 365 of file gpu_framebuffer.cc.
References blender::gpu::unwrap().
Referenced by draw_select_framebuffer_depth_only_setup(), GPU_offscreen_create(), and workbench_render_framebuffers_init().
| void GPU_framebuffer_clear | ( | GPUFrameBuffer * | fb, |
| eGPUFrameBufferBits | buffers, | ||
| const float | clear_col[4], | ||
| float | clear_depth, | ||
| unsigned int | clear_stencil ) |
Clear the frame-buffer attachments. buffers controls the types of attachments to clear. Setting GPU_COLOR_BIT will clear all the color attachment. Each attachment gets cleared to the value of its type:
Definition at line 466 of file gpu_framebuffer.cc.
References BLI_assert_msg, buffers, and blender::gpu::unwrap().
Referenced by blender::draw::command::Clear::execute(), GPU_framebuffer_clear_color(), GPU_framebuffer_clear_color_depth(), GPU_framebuffer_clear_color_depth_stencil(), GPU_framebuffer_clear_depth(), GPU_framebuffer_clear_depth_stencil(), GPU_framebuffer_clear_stencil(), and pygpu_framebuffer_clear().
| void GPU_framebuffer_clear_color | ( | GPUFrameBuffer * | fb, |
| const float | clear_col[4] ) |
Clear all color attachment textures with the value clear_col .
Definition at line 478 of file gpu_framebuffer.cc.
References fb(), GPU_COLOR_BIT, and GPU_framebuffer_clear().
Referenced by blender::eevee::Film::accumulate(), blender::image_engine::ScreenSpaceDrawingMode::draw_viewport(), GPU_offscreen_create(), blender::ed::vse::preview_draw_color_render_begin(), blender::eevee::ShadingView::render(), blender::draw::gpencil::render_init_buffers(), blender::gpu::tests::test_framebuffer_clear_color_multiple_attachments(), blender::gpu::tests::test_framebuffer_clear_color_single_attachment(), blender::gpu::tests::test_framebuffer_cube(), blender::gpu::tests::test_framebuffer_multi_viewport(), blender::gpu::tests::test_framebuffer_scissor_test(), and blender::gpu::tests::test_framebuffer_subpass_input().
| void GPU_framebuffer_clear_color_depth | ( | GPUFrameBuffer * | fb, |
| const float | clear_col[4], | ||
| float | clear_depth ) |
Clear all color attachment textures with the value clear_col and the depth attachment texture with the value clear_depth .
Definition at line 488 of file gpu_framebuffer.cc.
References fb(), GPU_COLOR_BIT, GPU_DEPTH_BIT, and GPU_framebuffer_clear().
Referenced by blender::draw::edit_select::Instance::begin_sync(), blender::render::hydra::GPURenderTaskDelegate::bind(), blender::eevee::Instance::draw_viewport(), GPU_offscreen_create(), blender::eevee::ShadingView::render(), and blender::eevee::CaptureView::render_probes().
| void GPU_framebuffer_clear_color_depth_stencil | ( | GPUFrameBuffer * | fb, |
| const float | clear_col[4], | ||
| float | clear_depth, | ||
| uint | clear_stencil ) |
Clear the depth attachment texture with the value clear_depth , the stencil attachment with the value clear_stencil and all the color attachments with the value clear_col .
Definition at line 505 of file gpu_framebuffer.cc.
References fb(), GPU_COLOR_BIT, GPU_DEPTH_BIT, GPU_framebuffer_clear(), and GPU_STENCIL_BIT.
| void GPU_framebuffer_clear_depth | ( | GPUFrameBuffer * | fb, |
| float | clear_depth ) |
Clear the depth attachment texture with the value clear_depth .
Definition at line 483 of file gpu_framebuffer.cc.
References fb(), GPU_DEPTH_BIT, and GPU_framebuffer_clear().
Referenced by blender::draw::Framebuffer::clear_depth(), blender::draw::edit_select::Instance::draw(), DRW_draw_depth_loop(), DRW_draw_select_loop(), blender::eevee::PlanarProbePipeline::render(), blender::draw::gpencil::render_init_buffers(), and blender::gpu::tests::test_framebuffer_clear_depth().
| void GPU_framebuffer_clear_depth_stencil | ( | GPUFrameBuffer * | fb, |
| float | clear_depth, | ||
| uint | clear_stencil ) |
Clear the depth attachment texture with the value clear_depth and the stencil attachment with the value clear_stencil .
Definition at line 500 of file gpu_framebuffer.cc.
References fb(), GPU_DEPTH_BIT, GPU_framebuffer_clear(), and GPU_STENCIL_BIT.
Referenced by blender::workbench::Instance::draw(), drw_draw_render_loop_2d(), and drw_draw_render_loop_3d().
| void GPU_framebuffer_clear_stencil | ( | GPUFrameBuffer * | fb, |
| uint | clear_stencil ) |
Clear the stencil attachment with the value clear_stencil .
Definition at line 495 of file gpu_framebuffer.cc.
References fb(), GPU_framebuffer_clear(), and GPU_STENCIL_BIT.
Referenced by blender::eevee::GBuffer::bind(), and blender::workbench::OpaquePass::draw().
| void GPU_framebuffer_config_array | ( | GPUFrameBuffer * | fb, |
| const GPUAttachment * | config, | ||
| int | config_len ) |
First GPUAttachment in *config is always the depth/depth_stencil buffer. Following #GPUAttachments are color buffers. Setting GPUAttachment.mip to -1 will leave the texture in this slot. Setting GPUAttachment.tex to nullptr will detach the texture in this slot.
Definition at line 404 of file gpu_framebuffer.cc.
References fb(), GPU_FB_COLOR_ATTACHMENT0, GPU_FB_DEPTH_ATTACHMENT, GPU_FB_DEPTH_STENCIL_ATTACHMENT, GPU_texture_has_stencil_format(), GPUAttachment::mip, GPUAttachment::tex, and blender::gpu::unwrap().
Referenced by blender::draw::Framebuffer::ensure(), and pygpu_framebuffer__tp_new().
| GPUFrameBuffer * GPU_framebuffer_create | ( | const char * | name | ) |
Create a #GPUFrameBuffer object. It is not configured and not bound to a specific context until GPU_framebuffer_bind() is called.
Definition at line 275 of file gpu_framebuffer.cc.
References blender::gpu::GPUBackend::get(), and blender::gpu::wrap().
Referenced by blender::render::hydra::GPURenderTaskDelegate::bind(), draw_select_framebuffer_depth_only_setup(), blender::draw::Framebuffer::ensure(), blender::draw::Framebuffer::ensure(), blender::gpu::tests::gpu_shader_lib_test(), pygpu_framebuffer__tp_new(), blender::gpu::tests::test_framebuffer_clear_color_multiple_attachments(), blender::gpu::tests::test_framebuffer_clear_color_single_attachment(), blender::gpu::tests::test_framebuffer_clear_depth(), blender::gpu::tests::test_framebuffer_clear_multiple_color_multiple_attachments(), blender::gpu::tests::test_framebuffer_multi_viewport(), blender::gpu::tests::test_framebuffer_scissor_test(), blender::gpu::tests::test_framebuffer_subpass_input(), and blender::gpu::tests::ShaderSpecializationConst::validate().
| void GPU_framebuffer_default_size | ( | GPUFrameBuffer * | fb, |
| int | width, | ||
| int | height ) |
Default size is used if the frame-buffer contains no attachments. It needs to be re-specified each time an attachment is added.
Definition at line 435 of file gpu_framebuffer.cc.
References blender::gpu::unwrap().
Referenced by blender::draw::Framebuffer::ensure(), and blender::gpu::tests::ShaderSpecializationConst::validate().
| void GPU_framebuffer_free | ( | GPUFrameBuffer * | fb | ) |
Create a #GPUFrameBuffer object. It is not configured and not bound to a specific context until GPU_framebuffer_bind() is called.
Definition at line 282 of file gpu_framebuffer.cc.
References fb(), and blender::gpu::unwrap().
Referenced by DRW_draw_depth_loop(), gizmo_find_intersected_3d(), gpu_offscreen_fb_get(), GPU_offscreen_free(), blender::gpu::tests::gpu_shader_lib_test(), pygpu_framebuffer_free_if_possible(), blender::gpu::tests::test_framebuffer_clear_color_multiple_attachments(), blender::gpu::tests::test_framebuffer_clear_color_single_attachment(), blender::gpu::tests::test_framebuffer_clear_depth(), blender::gpu::tests::test_framebuffer_clear_multiple_color_multiple_attachments(), blender::gpu::tests::test_framebuffer_multi_viewport(), blender::gpu::tests::test_framebuffer_scissor_test(), blender::gpu::tests::test_framebuffer_subpass_input(), blender::render::hydra::GPURenderTaskDelegate::unbind(), blender::gpu::tests::ShaderSpecializationConst::validate(), view3d_gpu_read_Z_pixels(), and blender::gpu::GLTexture::~GLTexture().
| const char * GPU_framebuffer_get_name | ( | GPUFrameBuffer * | fb | ) |
Definition at line 287 of file gpu_framebuffer.cc.
References fb(), and blender::gpu::unwrap().
Referenced by blender::draw::command::FramebufferBind::serialize().
| void GPU_framebuffer_multi_clear | ( | GPUFrameBuffer * | fb, |
| const float(*) | clear_colors[4] ) |
Clear each color attachment texture attached to this frame-buffer with a different color. IMPORTANT: The size of clear_colors must match the number of color attachments.
Definition at line 514 of file gpu_framebuffer.cc.
References BLI_assert_msg, fb(), and blender::gpu::unwrap().
Referenced by blender::draw::gpencil::Instance::draw(), blender::workbench::Instance::draw(), blender::draw::command::ClearMulti::execute(), and blender::gpu::tests::test_framebuffer_clear_multiple_color_multiple_attachments().
| void GPU_framebuffer_multi_viewports_set | ( | GPUFrameBuffer * | gpu_fb, |
| const int | viewport_rects[GPU_MAX_VIEWPORTS][4] ) |
Similar to GPU_framebuffer_viewport_set() but specify the bounds of all 16 viewports. By default geometry renders only to the first viewport. That can be changed by setting gpu_ViewportIndex in the vertex.
Definition at line 448 of file gpu_framebuffer.cc.
References GPU_MAX_VIEWPORTS, and blender::gpu::unwrap().
Referenced by blender::eevee::ShadowModule::set_view(), and blender::gpu::tests::test_framebuffer_multi_viewport().
| GPUFrameBuffer * GPU_framebuffer_pop | ( | ) |
Definition at line 652 of file gpu_framebuffer.cc.
References BLI_assert, and FrameBufferStack.
Referenced by GPU_offscreen_unbind(), and pygpu_framebuffer_stack_pop_and_restore_or_error().
| void GPU_framebuffer_push | ( | GPUFrameBuffer * | fb | ) |
Keep a stack of bound frame-buffer to allow scoped binding of frame-buffer in python. This is also used by GPUOffScreen to save/restore the current frame-buffers.
Definition at line 645 of file gpu_framebuffer.cc.
References BLI_assert, fb(), FRAMEBUFFER_STACK_DEPTH, and FrameBufferStack.
Referenced by GPU_offscreen_bind(), and pygpu_framebuffer_stack_push_and_bind_or_error().
| void ** GPU_framebuffer_py_reference_get | ( | GPUFrameBuffer * | fb | ) |
Reference of a pointer that needs to be cleaned when deallocating the frame-buffer. Points to BPyGPUFrameBuffer.fb
Definition at line 618 of file gpu_framebuffer.cc.
References fb(), and blender::gpu::unwrap().
Referenced by BPyGPUFrameBuffer_CreatePyObject().
| void GPU_framebuffer_py_reference_set | ( | GPUFrameBuffer * | fb, |
| void ** | py_ref ) |
Definition at line 623 of file gpu_framebuffer.cc.
References BLI_assert, fb(), and blender::gpu::unwrap().
Referenced by BPyGPUFrameBuffer_CreatePyObject(), and pygpu_framebuffer_free_safe().
| void GPU_framebuffer_read_color | ( | GPUFrameBuffer * | fb, |
| int | x, | ||
| int | y, | ||
| int | width, | ||
| int | height, | ||
| int | channels, | ||
| int | slot, | ||
| eGPUDataFormat | data_format, | ||
| void * | r_data ) |
Read a region of a framebuffer color attachment and copy it to r_data . The pixel data will be converted to data_format but it needs to be compatible with the attachment type. DEPRECATED: Prefer using GPU_texture_read().
Definition at line 547 of file gpu_framebuffer.cc.
References data, fb(), GPU_COLOR_BIT, blender::gpu::unwrap(), w(), x, and y.
Referenced by DRW_select_buffer_read(), GPU_offscreen_read_color_region(), pygpu_framebuffer_read_color(), blender::draw::gpencil::render_result_combined(), blender::draw::gpencil::render_result_separated_pass(), and write_render_color_output().
| void GPU_framebuffer_read_depth | ( | GPUFrameBuffer * | fb, |
| int | x, | ||
| int | y, | ||
| int | width, | ||
| int | height, | ||
| eGPUDataFormat | data_format, | ||
| void * | r_data ) |
Read a region of the framebuffer depth attachment and copy it to r_data . The pixel data will be converted to data_format but it needs to be compatible with the attachment type. DEPRECATED: Prefer using GPU_texture_read().
Definition at line 540 of file gpu_framebuffer.cc.
References data, fb(), GPU_DEPTH_BIT, blender::gpu::unwrap(), w(), x, and y.
Referenced by gpu_select_pick_load_id(), pygpu_framebuffer_read_depth(), blender::draw::gpencil::render_result_z(), view3d_gpu_read_Z_pixels(), and write_render_z_output().
| void GPU_framebuffer_recursive_downsample | ( | GPUFrameBuffer * | fb, |
| int | max_level, | ||
| void(* | per_level_callback )(void *user_data, int level), | ||
| void * | user_data ) |
Call per_level_callback after binding each framebuffer attachment mip level up until max_level . Each attachment texture sampler mip range is set to not overlap the currently processed level. This is used for generating custom mip-map chains where each level needs access to the one above. DEPRECATED: Prefer using a compute shader with arbitrary imageLoad/Store for this purpose as it is clearer and likely faster with optimizations.
Definition at line 609 of file gpu_framebuffer.cc.
References fb(), and blender::gpu::unwrap().
Referenced by blender::workbench::DofPass::draw().
| void GPU_framebuffer_restore | ( | ) |
Binds back the active context's default frame-buffer. Equivalent to GPU_backbuffer_bind(GPU_BACKBUFFER_LEFT).
Definition at line 341 of file gpu_framebuffer.cc.
References blender::gpu::Context::back_left, blender::gpu::FrameBuffer::bind(), and blender::gpu::Context::get().
Referenced by blender::ed::space_node::draw_nodespace_back_pix(), DRW_custom_pipeline_end(), DRW_draw_depth_loop(), drw_draw_render_loop_2d(), drw_draw_render_loop_3d(), DRW_draw_render_loop_offscreen(), DRW_draw_select_loop(), DRW_render_gpencil(), DRW_render_to_image(), DRW_select_buffer_read(), ED_view3d_draw_offscreen_imbuf(), gizmo_find_intersected_3d(), GPU_offscreen_create(), GPU_offscreen_unbind(), GPU_viewport_stereo_composite(), GPU_viewport_unbind(), blender::ed::vse::sequencer_ibuf_get(), view3d_gpu_read_Z_pixels(), wm_xr_draw_view(), wm_xr_session_surface_draw(), blender::gpu::GLFrameBuffer::~GLFrameBuffer(), and blender::gpu::MTLFrameBuffer::~MTLFrameBuffer().
| uint GPU_framebuffer_stack_level_get | ( | ) |
Definition at line 659 of file gpu_framebuffer.cc.
References FrameBufferStack.
Referenced by pygpu_framebuffer_stack_context_enter(), pygpu_framebuffer_stack_context_exit(), pygpu_framebuffer_stack_pop_and_restore_or_error(), pygpu_framebuffer_stack_push_and_bind_or_error(), pygpu_offscreen_stack_context_enter(), and pygpu_offscreen_stack_context_exit().
| void GPU_framebuffer_subpass_transition_array | ( | GPUFrameBuffer * | fb, |
| const GPUAttachmentState * | attachment_states, | ||
| uint | attachment_len ) |
Sub-pass config array matches attachment structure of GPU_framebuffer_config_array. This allows to explicitly specify attachment state within the next sub-pass. This enables a number of bandwidth optimizations specially on Tile Based Deferred Renderers where the attachments can be kept into tile memory and used in place for later sub-passes.
IMPORTANT: When using this, the framebuffer initial state is undefined. A sub-pass transition need to be issued before any draw-call.
Example:
Definition at line 315 of file gpu_framebuffer.cc.
References fb(), and blender::gpu::unwrap().
Referenced by blender::draw::command::SubPassTransition::execute().
| void GPU_framebuffer_texture_attach | ( | GPUFrameBuffer * | fb, |
| GPUTexture * | texture, | ||
| int | slot, | ||
| int | mip ) |
Attach an entire texture mip level to a #GPUFrameBuffer. Changes will only take effect next time GPU_framebuffer_bind() is called. slot is the color texture slot to bind this texture to. Must be 0 if it is the depth texture. mip is the mip level of this texture to attach to the framebuffer. DEPRECATED: Prefer using multiple #GPUFrameBuffer with different configurations with GPU_framebuffer_config_array().
Definition at line 379 of file gpu_framebuffer.cc.
References fb(), GPU_ATTACHMENT_TEXTURE_MIP, and gpu_framebuffer_texture_attach_ex().
Referenced by draw_select_framebuffer_depth_only_setup().
|
static |
Definition at line 370 of file gpu_framebuffer.cc.
References blender::gpu::Texture::attachment_type(), GPUAttachment::tex, and blender::gpu::unwrap().
Referenced by GPU_framebuffer_texture_attach(), GPU_framebuffer_texture_cubeface_attach(), and GPU_framebuffer_texture_layer_attach().
| void GPU_framebuffer_texture_cubeface_attach | ( | GPUFrameBuffer * | fb, |
| GPUTexture * | texture, | ||
| int | slot, | ||
| int | face, | ||
| int | mip ) |
Attach a single cube-face of an cube-map texture mip level to a #GPUFrameBuffer. Changes will only take effect next time GPU_framebuffer_bind() is called. slot is the color texture slot to bind this texture to. Must be 0 if it is the depth texture. face is the cube-face of this cube-map texture to attach to the framebuffer. mip is the mip level of this texture to attach to the framebuffer. DEPRECATED: Prefer using multiple #GPUFrameBuffer with different configurations with GPU_framebuffer_config_array().
Definition at line 392 of file gpu_framebuffer.cc.
References fb(), GPU_ATTACHMENT_TEXTURE_CUBEFACE_MIP, and gpu_framebuffer_texture_attach_ex().
| void GPU_framebuffer_texture_detach | ( | GPUFrameBuffer * | fb, |
| GPUTexture * | texture ) |
Detach a texture from a #GPUFrameBuffer. The texture must be attached. Changes will only take effect next time GPU_framebuffer_bind() is called. DEPRECATED: Prefer using multiple #GPUFrameBuffer with different configurations with GPU_framebuffer_config_array().
Definition at line 399 of file gpu_framebuffer.cc.
References fb(), and blender::gpu::unwrap().
| void GPU_framebuffer_texture_layer_attach | ( | GPUFrameBuffer * | fb, |
| GPUTexture * | texture, | ||
| int | slot, | ||
| int | layer, | ||
| int | mip ) |
Attach a single layer of an array texture mip level to a #GPUFrameBuffer. Changes will only take effect next time GPU_framebuffer_bind() is called. slot is the color texture slot to bind this texture to. Must be 0 if it is the depth texture. layer is the layer of this array texture to attach to the framebuffer. mip is the mip level of this texture to attach to the framebuffer. DEPRECATED: Prefer using multiple #GPUFrameBuffer with different configurations with GPU_framebuffer_config_array().
Definition at line 385 of file gpu_framebuffer.cc.
References fb(), GPU_ATTACHMENT_TEXTURE_LAYER_MIP, and gpu_framebuffer_texture_attach_ex().
| void GPU_framebuffer_viewport_get | ( | GPUFrameBuffer * | fb, |
| int | r_viewport[4] ) |
Return the viewport offset and size in a int quadruple: (x, y, width, height).
Definition at line 454 of file gpu_framebuffer.cc.
References blender::gpu::unwrap().
Referenced by pygpu_framebuffer_viewport_get().
| void GPU_framebuffer_viewport_reset | ( | GPUFrameBuffer * | fb | ) |
Reset a frame-buffer viewport bounds to its attachment(s) size.
Definition at line 459 of file gpu_framebuffer.cc.
References blender::gpu::unwrap().
Referenced by blender::eevee::LookdevModule::display(), and blender::eevee::Instance::draw().
| void GPU_framebuffer_viewport_set | ( | GPUFrameBuffer * | fb, |
| int | x, | ||
| int | y, | ||
| int | width, | ||
| int | height ) |
Set a the viewport offset and size. These are reset to the original dimensions explicitly (using GPU_framebuffer_viewport_reset()) or when binding the frame-buffer after modifying its attachments.
Definition at line 442 of file gpu_framebuffer.cc.
References blender::gpu::unwrap(), x, and y.
Referenced by blender::eevee::Film::accumulate(), blender::eevee::Film::display(), and pygpu_framebuffer_viewport_set().
| void GPU_frontbuffer_read_color | ( | int | x, |
| int | y, | ||
| int | width, | ||
| int | height, | ||
| int | channels, | ||
| eGPUDataFormat | data_format, | ||
| void * | r_data ) |
Read a the color of the window screen as it is currently displayed (so the previously rendered back-buffer). DEPRECATED: This isn't even working correctly on some implementation. TODO: Emulate this by doing some slow texture copy on the backend side or try to read the areas offscreen textures directly.
Definition at line 561 of file gpu_framebuffer.cc.
References data, blender::gpu::Context::front_left, blender::gpu::Context::get(), GPU_COLOR_BIT, blender::gpu::FrameBuffer::read(), w(), x, and y.
Referenced by WM_window_pixels_read_from_frontbuffer(), and WM_window_pixels_read_sample_from_frontbuffer().
| void GPU_offscreen_bind | ( | GPUOffScreen * | offscreen, |
| bool | save ) |
Unbind a GPUOffScreen from a #GPUContext. If save is true, it will save the currently bound framebuffer into a stack.
Definition at line 808 of file gpu_framebuffer.cc.
References fb(), GPU_framebuffer_active_get(), GPU_framebuffer_push(), gpu_offscreen_fb_get(), and blender::gpu::unwrap().
Referenced by blender::gpu::tests::blend_test(), DRW_draw_render_loop_offscreen(), ED_view3d_draw_offscreen_imbuf(), GPU_viewport_unbind_from_offscreen(), blender::ed::greasepencil::image_render::image_render_begin(), pygpu_offscreen_draw_view3d(), pygpu_offscreen_stack_context_enter(), screen_opengl_render_doit(), blender::gpu::tests::test_immediate_one_plane(), blender::gpu::tests::test_immediate_two_planes(), blender::gpu::tests::vertex_buffer_fetch_mode(), wm_draw_region_bind(), wm_draw_window(), WM_window_pixels_read_from_offscreen(), WM_window_pixels_read_sample_from_offscreen(), and wm_xr_draw_view().
| GPUTexture * GPU_offscreen_color_texture | ( | const GPUOffScreen * | offscreen | ) |
Return the color texture of a GPUOffScreen. Does not give ownership.
Definition at line 871 of file gpu_framebuffer.cc.
References GPUOffScreen::color.
Referenced by blender::gpu::tests::blend_test(), pygpu_offscreen_color_texture_get(), pygpu_offscreen_texture_color_get(), blender::gpu::tests::vertex_buffer_fetch_mode(), wm_draw_offscreen_texture_parameters(), wm_draw_region_texture(), and wm_draw_window().
| GPUOffScreen * GPU_offscreen_create | ( | int | width, |
| int | height, | ||
| bool | with_depth_buffer, | ||
| eGPUTextureFormat | format, | ||
| eGPUTextureUsage | usage, | ||
| bool | clear, | ||
| char | err_out[256] ) |
Create a GPUOffScreen with attachment size of width by height pixels. If with_depth_buffer is true, a depth buffer attachment will also be created. format is the format of the color buffer. If clear is true, the color and depth buffer attachments will be cleared. If err_out is not nullptr it will be use to write any configuration error message..
Definition at line 728 of file gpu_framebuffer.cc.
References BLI_strncpy(), clear(), GPUOffScreen::color, GPUOffScreen::depth, error(), fb(), GPU_DEPTH24_STENCIL8, GPU_framebuffer_bind(), GPU_framebuffer_check_valid(), GPU_framebuffer_clear_color(), GPU_framebuffer_clear_color_depth(), GPU_framebuffer_restore(), gpu_offscreen_fb_get(), GPU_offscreen_free(), GPU_texture_create_2d(), GPU_TEXTURE_USAGE_ATTACHMENT, GPU_TEXTURE_USAGE_FORMAT_VIEW, max_ii(), and MEM_callocN().
Referenced by blender::gpu::tests::blend_test(), ED_view3d_draw_offscreen_imbuf(), blender::ed::greasepencil::image_render::image_render_begin(), pygpu_offscreen__tp_new(), screen_opengl_render_init(), blender::gpu::tests::test_immediate_one_plane(), blender::gpu::tests::test_immediate_two_planes(), blender::gpu::tests::vertex_buffer_fetch_mode(), wm_draw_region_buffer_create(), wm_draw_window(), WM_window_pixels_read_from_offscreen(), WM_window_pixels_read_sample_from_offscreen(), and wm_xr_session_surface_offscreen_ensure().
| void GPU_offscreen_draw_to_screen | ( | GPUOffScreen * | offscreen, |
| int | x, | ||
| int | y ) |
Blit the offscreen color texture to the active framebuffer at the (x, y) location.
Definition at line 832 of file gpu_framebuffer.cc.
References blender::gpu::Context::active_fb, blender::gpu::FrameBuffer::blit_to(), blender::gpu::Context::get(), GPU_COLOR_BIT, gpu_offscreen_fb_get(), blender::gpu::unwrap(), x, and y.
Referenced by wm_draw_region_blit().
|
static |
Returns the correct frame-buffer for the current context.
Definition at line 690 of file gpu_framebuffer.cc.
References BLI_assert, GPUOffScreen::framebuffers, blender::gpu::Context::get(), GPU_framebuffer_ensure_config, GPU_framebuffer_free(), gpu_offscreen_fb_get(), and printf.
Referenced by GPU_offscreen_bind(), GPU_offscreen_create(), GPU_offscreen_draw_to_screen(), gpu_offscreen_fb_get(), GPU_offscreen_read_color_region(), and GPU_offscreen_viewport_data_get().
| eGPUTextureFormat GPU_offscreen_format | ( | const GPUOffScreen * | offscreen | ) |
Return the texture format of a GPUOffScreen.
Definition at line 876 of file gpu_framebuffer.cc.
References GPUOffScreen::color, and GPU_texture_format().
Referenced by ED_view3d_draw_offscreen_imbuf(), and wm_draw_region_buffer_create().
| void GPU_offscreen_free | ( | GPUOffScreen * | offscreen | ) |
Free a GPUOffScreen.
Definition at line 791 of file gpu_framebuffer.cc.
References GPUOffScreen::color, GPUOffScreen::depth, GPUOffScreen::framebuffers, GPU_framebuffer_free(), GPU_texture_free(), and MEM_freeN().
Referenced by blender::gpu::tests::blend_test(), BPyGPUOffScreen__tp_dealloc(), ED_view3d_draw_offscreen_imbuf(), GPU_offscreen_create(), blender::ed::greasepencil::image_render::image_render_end(), pygpu_offscreen_free(), screen_opengl_render_end(), blender::gpu::tests::test_immediate_one_plane(), blender::gpu::tests::test_immediate_two_planes(), blender::gpu::tests::vertex_buffer_fetch_mode(), wm_draw_region_buffer_free(), wm_draw_window(), WM_window_pixels_read_from_offscreen(), WM_window_pixels_read_sample_from_offscreen(), wm_xr_session_surface_free_data(), and wm_xr_session_surface_offscreen_ensure().
| int GPU_offscreen_height | ( | const GPUOffScreen * | offscreen | ) |
Return the height of a GPUOffScreen.
Definition at line 866 of file gpu_framebuffer.cc.
References GPUOffScreen::color, and GPU_texture_height().
Referenced by ED_view3d_draw_offscreen_imbuf(), GPU_viewport_bind_from_offscreen(), blender::ed::greasepencil::image_render::image_render_end(), pygpu_offscreen_draw_view3d(), pygpu_offscreen_height_get(), wm_draw_region_buffer_create(), and wm_xr_session_surface_offscreen_ensure().
| void GPU_offscreen_read_color | ( | GPUOffScreen * | offscreen, |
| eGPUDataFormat | data_format, | ||
| void * | r_data ) |
Read the whole color texture of the a GPUOffScreen. The pixel data will be converted to data_format but it needs to be compatible with the attachment type. IMPORTANT: r_data must be big enough for all pixels in data_format.
Definition at line 851 of file gpu_framebuffer.cc.
References BLI_assert, GPUOffScreen::color, ELEM, GPU_DATA_FLOAT, GPU_DATA_UBYTE, GPU_offscreen_read_color_region(), GPU_texture_height(), GPU_texture_width(), and w().
Referenced by blender::gpu::tests::blend_test(), ED_view3d_draw_offscreen_imbuf(), blender::ed::greasepencil::image_render::image_render_end(), screen_opengl_render_doit(), blender::gpu::tests::test_immediate_one_plane(), blender::gpu::tests::test_immediate_two_planes(), blender::gpu::tests::vertex_buffer_fetch_mode(), and WM_window_pixels_read_from_offscreen().
| void GPU_offscreen_read_color_region | ( | GPUOffScreen * | offscreen, |
| eGPUDataFormat | data_format, | ||
| int | x, | ||
| int | y, | ||
| int | w, | ||
| int | h, | ||
| void * | r_data ) |
A version of GPU_offscreen_read_color that reads into a region.
Definition at line 839 of file gpu_framebuffer.cc.
References BLI_assert, GPUOffScreen::color, ELEM, GPU_DATA_FLOAT, GPU_DATA_UBYTE, GPU_framebuffer_read_color(), gpu_offscreen_fb_get(), GPU_texture_height(), GPU_texture_width(), w(), x, and y.
Referenced by GPU_offscreen_read_color(), and WM_window_pixels_read_sample_from_offscreen().
| void GPU_offscreen_unbind | ( | GPUOffScreen * | offscreen, |
| bool | restore ) |
Unbind a GPUOffScreen from a #GPUContext. If restore is true, it will restore the previously bound framebuffer. If false, it will bind the window back-buffer.
Definition at line 817 of file gpu_framebuffer.cc.
References fb(), GPU_framebuffer_bind(), GPU_framebuffer_pop(), and GPU_framebuffer_restore().
Referenced by blender::gpu::tests::blend_test(), ED_view3d_draw_offscreen_imbuf(), blender::ed::greasepencil::image_render::image_render_end(), pygpu_offscreen_draw_view3d(), pygpu_offscreen_stack_context_exit(), pygpu_offscreen_unbind(), screen_opengl_render_doit(), blender::gpu::tests::test_immediate_one_plane(), blender::gpu::tests::test_immediate_two_planes(), blender::gpu::tests::vertex_buffer_fetch_mode(), wm_draw_region_unbind(), wm_draw_window(), WM_window_pixels_read_from_offscreen(), and WM_window_pixels_read_sample_from_offscreen().
| void GPU_offscreen_viewport_data_get | ( | GPUOffScreen * | offscreen, |
| GPUFrameBuffer ** | r_fb, | ||
| GPUTexture ** | r_color, | ||
| GPUTexture ** | r_depth ) |
Return the internals of a GPUOffScreen. Does not give ownership.
Definition at line 881 of file gpu_framebuffer.cc.
References GPUOffScreen::color, GPUOffScreen::depth, and gpu_offscreen_fb_get().
Referenced by GPU_viewport_bind_from_offscreen().
| int GPU_offscreen_width | ( | const GPUOffScreen * | offscreen | ) |
Return the width of a GPUOffScreen.
Definition at line 861 of file gpu_framebuffer.cc.
References GPUOffScreen::color, and GPU_texture_width().
Referenced by ED_view3d_draw_offscreen_imbuf(), GPU_viewport_bind_from_offscreen(), blender::ed::greasepencil::image_render::image_render_end(), pygpu_offscreen_draw_view3d(), pygpu_offscreen_width_get(), wm_draw_region_buffer_create(), and wm_xr_session_surface_offscreen_ensure().
| GPUFrameBuffer* framebuffers[FRAMEBUFFER_STACK_DEPTH] |
Definition at line 641 of file gpu_framebuffer.cc.
Referenced by blender::gpu::tests::test_framebuffer_cube().
| struct { ... } FrameBufferStack |
Referenced by GPU_framebuffer_pop(), GPU_framebuffer_push(), and GPU_framebuffer_stack_level_get().
| uint top |
Definition at line 642 of file gpu_framebuffer.cc.
Referenced by blender::ed::vse::StripsDrawBatch::add_strip(), BKE_tracking_get_projection_matrix(), BLF_thumb_preview(), BLI_STATIC_ASSERT(), calc_text_rcts(), convexhull_2d_sorted(), blender::nodes::node_geo_curve_primitive_quadrilateral_cc::create_trapezoid_curve(), GHOST_ISystem::createWindow(), GHOST_SystemCocoa::createWindow(), GHOST_SystemHeadless::createWindow(), GHOST_SystemWayland::createWindow(), GHOST_SystemWin32::createWindow(), GHOST_SystemX11::createWindow(), blender::ed::vse::draw_icon_centered(), blender::eevee::VolumeModule::draw_prepass(), blender::ed::vse::draw_seq_waveform_overlay(), draw_suggestion_list(), blender::ed::vse::drawmeta_contents(), blender::draw::View::frustum_boundbox_calc(), getOpenGLSubMatrix(), GHOST_CreateWindow(), GHOST_WindowSDL::GHOST_WindowSDL(), GHOST_WindowWin32::GHOST_WindowWin32(), GHOST_WindowX11::GHOST_WindowX11(), GPU_matrix_frustum_set(), GPU_matrix_ortho_2d_set(), GPU_matrix_ortho_set(), GPU_matrix_unproject_precalc(), IMB_flipy(), imm_draw_cylinder_fill_3d(), imm_draw_cylinder_fill_normal_3d(), imm_draw_cylinder_wire_3d(), immDrawPixelsTexTiled_scaling_clipping(), interp_weights_poly_v2(), mat4_frustum_set(), mat4_ortho_set(), blender::nodes::node_geo_curve_primitive_quadrilateral_cc::node_declare(), Freestyle::NodePerspectiveCamera::NodePerspectiveCamera(), blender::math::projection::orthographic(), blender::math::projection::orthographic(), blender::math::projection::orthographic_infinite(), blender::math::projection::orthographic_infinite(), orthographic_m4(), osl_closure_layer_params(), blender::math::projection::perspective(), blender::math::projection::perspective(), blender::math::projection::perspective_infinite(), blender::math::projection::perspective_infinite(), perspective_m4(), planes_from_projmat(), screen_areas_align(), screen_draw_area_drag_tip(), blender::seq::sequencer_image_crop_init(), blender::ed::vse::sequencer_retiming_draw_continuity(), SKY_nishita_skymodel_precompute_sun(), space_text_do_suggest_select(), space_text_get_line_pos_wrapped(), StereoProjection(), text_pop_suggest_list(), texttool_suggest_prefix(), thumb_data_vertical_flip(), timeline_cache_draw_geometry_nodes(), txt_clean_text(), ui_popup_block_position(), libmv::VerticalStack(), View(), and libmv::VStack().