Blender V5.0
GPU_state.hh File Reference
#include "BLI_utildefines.h"

Go to the source code of this file.

Enumerations

enum  GPUWriteMask {
  GPU_WRITE_NONE = 0 , GPU_WRITE_RED = (1 << 0) , GPU_WRITE_GREEN = (1 << 1) , GPU_WRITE_BLUE = (1 << 2) ,
  GPU_WRITE_ALPHA = (1 << 3) , GPU_WRITE_DEPTH = (1 << 4) , GPU_WRITE_STENCIL = (1 << 5) , GPU_WRITE_COLOR = (GPU_WRITE_RED | GPU_WRITE_GREEN | GPU_WRITE_BLUE | GPU_WRITE_ALPHA)
}
enum  GPUBarrier {
  GPU_BARRIER_FRAMEBUFFER = (1 << 0) , GPU_BARRIER_SHADER_IMAGE_ACCESS = (1 << 1) , GPU_BARRIER_TEXTURE_FETCH = (1 << 2) , GPU_BARRIER_TEXTURE_UPDATE = (1 << 3) ,
  GPU_BARRIER_COMMAND = (1 << 10) , GPU_BARRIER_SHADER_STORAGE = (1 << 11) , GPU_BARRIER_VERTEX_ATTRIB_ARRAY = (1 << 12) , GPU_BARRIER_ELEMENT_ARRAY = (1 << 13) ,
  GPU_BARRIER_UNIFORM = (1 << 14) , GPU_BARRIER_BUFFER_UPDATE = (1 << 15)
}
enum  GPUStageBarrierBits {
  GPU_BARRIER_STAGE_VERTEX = (1 << 0) , GPU_BARRIER_STAGE_FRAGMENT = (1 << 1) , GPU_BARRIER_STAGE_COMPUTE = (1 << 2) , GPU_BARRIER_STAGE_ANY_GRAPHICS = (GPU_BARRIER_STAGE_VERTEX | GPU_BARRIER_STAGE_FRAGMENT) ,
  GPU_BARRIER_STAGE_ANY
}
enum  GPUBlend {
  GPU_BLEND_NONE = 0 , GPU_BLEND_ALPHA , GPU_BLEND_ALPHA_PREMULT , GPU_BLEND_ADDITIVE ,
  GPU_BLEND_ADDITIVE_PREMULT , GPU_BLEND_MULTIPLY , GPU_BLEND_SUBTRACT , GPU_BLEND_INVERT ,
  GPU_BLEND_OIT , GPU_BLEND_BACKGROUND , GPU_BLEND_CUSTOM , GPU_BLEND_ALPHA_UNDER_PREMUL ,
  GPU_BLEND_OVERLAY_MASK_FROM_ALPHA
}
enum  GPUDepthTest {
  GPU_DEPTH_NONE = 0 , GPU_DEPTH_ALWAYS , GPU_DEPTH_LESS , GPU_DEPTH_LESS_EQUAL ,
  GPU_DEPTH_EQUAL , GPU_DEPTH_GREATER , GPU_DEPTH_GREATER_EQUAL
}
enum  GPUStencilTest { GPU_STENCIL_NONE = 0 , GPU_STENCIL_ALWAYS , GPU_STENCIL_EQUAL , GPU_STENCIL_NEQUAL }
enum  GPUStencilOp { GPU_STENCIL_OP_NONE = 0 , GPU_STENCIL_OP_REPLACE , GPU_STENCIL_OP_COUNT_DEPTH_PASS , GPU_STENCIL_OP_COUNT_DEPTH_FAIL }
enum  GPUFaceCullTest { GPU_CULL_NONE = 0 , GPU_CULL_FRONT , GPU_CULL_BACK }
enum  GPUProvokingVertex { GPU_VERTEX_LAST = 0 , GPU_VERTEX_FIRST = 1 }

Functions

void GPU_blend (GPUBlend blend)
void GPU_face_culling (GPUFaceCullTest culling)
void GPU_depth_test (GPUDepthTest test)
void GPU_stencil_test (GPUStencilTest test)
void GPU_provoking_vertex (GPUProvokingVertex vert)
void GPU_front_facing (bool invert)
void GPU_depth_range (float near, float far)
void GPU_scissor_test (bool enable)
void GPU_line_smooth (bool enable)
void GPU_line_width (float width)
void GPU_logic_op_xor_set (bool enable)
void GPU_point_size (float size)
void GPU_polygon_smooth (bool enable)
void GPU_program_point_size (bool enable)
void GPU_scissor (int x, int y, int width, int height)
void GPU_scissor_get (int coords[4])
void GPU_viewport (int x, int y, int width, int height)
void GPU_viewport_size_get_f (float coords[4])
void GPU_viewport_size_get_i (int coords[4])
void GPU_write_mask (GPUWriteMask mask)
void GPU_color_mask (bool r, bool g, bool b, bool a)
void GPU_depth_mask (bool depth)
bool GPU_depth_mask_get ()
void GPU_shadow_offset (bool enable)
void GPU_clip_distances (int distances_enabled)
bool GPU_mipmap_enabled ()
void GPU_state_set (GPUWriteMask write_mask, GPUBlend blend, GPUFaceCullTest culling_test, GPUDepthTest depth_test, GPUStencilTest stencil_test, GPUStencilOp stencil_op, GPUProvokingVertex provoking_vert)
void GPU_stencil_reference_set (uint reference)
void GPU_stencil_write_mask_set (uint write_mask)
void GPU_stencil_compare_mask_set (uint compare_mask)
void GPU_clip_control_unit_range (bool enable)
GPUFaceCullTest GPU_face_culling_get ()
GPUBlend GPU_blend_get ()
GPUDepthTest GPU_depth_test_get ()
GPUWriteMask GPU_write_mask_get ()
uint GPU_stencil_mask_get ()
GPUStencilTest GPU_stencil_test_get ()
float GPU_line_width_get ()
bool GPU_line_smooth_get ()
void GPU_flush ()
void GPU_finish ()
void GPU_apply_state ()
void GPU_memory_barrier (GPUBarrier barrier)
GPUFence * GPU_fence_create ()
void GPU_fence_free (GPUFence *fence)
void GPU_fence_signal (GPUFence *fence)
void GPU_fence_wait (GPUFence *fence)

Enumeration Type Documentation

◆ GPUBarrier

enum GPUBarrier
Enumerator
GPU_BARRIER_FRAMEBUFFER 

All written texture prior to this barrier can be bound as frame-buffer attachment.

GPU_BARRIER_SHADER_IMAGE_ACCESS 

All written texture prior to this barrier can be bound as image.

GPU_BARRIER_TEXTURE_FETCH 

All written texture prior to this barrier can be bound as sampler.

GPU_BARRIER_TEXTURE_UPDATE 

All written texture prior to this barrier can be read or updated with CPU memory.

GPU_BARRIER_COMMAND 

All written texture prior to this barrier can be read or updated with PBO. All written buffer prior to this barrier can be bound as indirect command buffer.

GPU_BARRIER_SHADER_STORAGE 

All written buffer prior to this barrier can be bound as SSBO.

GPU_BARRIER_VERTEX_ATTRIB_ARRAY 

All written buffer prior to this barrier can be bound as VBO.

GPU_BARRIER_ELEMENT_ARRAY 

All written buffer prior to this barrier can be bound as IBO.

GPU_BARRIER_UNIFORM 

All written buffer prior to this barrier can be bound as UBO.

GPU_BARRIER_BUFFER_UPDATE 

All written buffer prior to this barrier can be read or updated with CPU memory.

Definition at line 29 of file GPU_state.hh.

◆ GPUBlend

enum GPUBlend

Defines the fixed pipeline blending equation. SRC is the output color from the shader. DST is the color from the frame-buffer. The blending equation is: (SRC * A) + (DST * B). The blend mode will modify the A and B parameters.

Enumerator
GPU_BLEND_NONE 
GPU_BLEND_ALPHA 

Pre-multiply variants will NOT multiply rgb output by alpha.

GPU_BLEND_ALPHA_PREMULT 
GPU_BLEND_ADDITIVE 
GPU_BLEND_ADDITIVE_PREMULT 
GPU_BLEND_MULTIPLY 
GPU_BLEND_SUBTRACT 
GPU_BLEND_INVERT 

Replace logic op: SRC * (1 - DST) NOTE: Does not modify alpha.

GPU_BLEND_OIT 

Order independent transparency. NOTE: Cannot be used as is. Needs special setup (frame-buffer, shader ...).

GPU_BLEND_BACKGROUND 

Special blend to add color under and multiply DST color by SRC alpha.

GPU_BLEND_CUSTOM 

Custom blend parameters using dual source blending : SRC0 + SRC1 * DST NOTE: Can only be used with ONE Draw Buffer and shader needs to be specialized.

GPU_BLEND_ALPHA_UNDER_PREMUL 
GPU_BLEND_OVERLAY_MASK_FROM_ALPHA 

Multiplies every channel (alpha included) by 1 - SRC.a. Used for piercing a hole using an image alpha channel.

Definition at line 84 of file GPU_state.hh.

◆ GPUDepthTest

Enumerator
GPU_DEPTH_NONE 
GPU_DEPTH_ALWAYS 
GPU_DEPTH_LESS 
GPU_DEPTH_LESS_EQUAL 
GPU_DEPTH_EQUAL 
GPU_DEPTH_GREATER 
GPU_DEPTH_GREATER_EQUAL 

Definition at line 110 of file GPU_state.hh.

◆ GPUFaceCullTest

Enumerator
GPU_CULL_NONE 
GPU_CULL_FRONT 
GPU_CULL_BACK 

Definition at line 135 of file GPU_state.hh.

◆ GPUProvokingVertex

Enumerator
GPU_VERTEX_LAST 
GPU_VERTEX_FIRST 

Definition at line 141 of file GPU_state.hh.

◆ GPUStageBarrierBits

Enumerator
GPU_BARRIER_STAGE_VERTEX 
GPU_BARRIER_STAGE_FRAGMENT 
GPU_BARRIER_STAGE_COMPUTE 
GPU_BARRIER_STAGE_ANY_GRAPHICS 
GPU_BARRIER_STAGE_ANY 

Definition at line 65 of file GPU_state.hh.

◆ GPUStencilOp

Enumerator
GPU_STENCIL_OP_NONE 
GPU_STENCIL_OP_REPLACE 
GPU_STENCIL_OP_COUNT_DEPTH_PASS 

Special values for stencil shadows.

GPU_STENCIL_OP_COUNT_DEPTH_FAIL 

Definition at line 127 of file GPU_state.hh.

◆ GPUStencilTest

Enumerator
GPU_STENCIL_NONE 
GPU_STENCIL_ALWAYS 
GPU_STENCIL_EQUAL 
GPU_STENCIL_NEQUAL 

Definition at line 120 of file GPU_state.hh.

◆ GPUWriteMask

Enumerator
GPU_WRITE_NONE 
GPU_WRITE_RED 
GPU_WRITE_GREEN 
GPU_WRITE_BLUE 
GPU_WRITE_ALPHA 
GPU_WRITE_DEPTH 
GPU_WRITE_STENCIL 
GPU_WRITE_COLOR 

Definition at line 16 of file GPU_state.hh.

Function Documentation

◆ GPU_apply_state()

◆ GPU_blend()

void GPU_blend ( GPUBlend blend)

Definition at line 42 of file gpu_state.cc.

References blend(), and SET_IMMUTABLE_STATE.

Referenced by ANIM_channel_draw(), ANIM_draw_action_framerange(), ANIM_draw_framerange(), ANIM_draw_previewrange(), ANIM_draw_scene_strip_range(), annotation_draw_data(), annotation_draw_eraser(), annotation_draw_stabilizer(), arrow_draw_intern(), blender::gpu::tests::blend_test(), blf_batch_draw(), brush_drawcursor(), button2d_draw_intern(), channel_list_draw_keys(), clip_draw_dopesheet_channels(), clip_draw_dopesheet_main(), cursor_box_draw(), blender::ed::curves::curve_draw_stroke_3d(), curve_draw_stroke_3d(), BlenderDisplayDriver::draw(), blender::ed::spreadsheet::draw_alternating_row_overlay(), draw_anti_tria(), draw_azone_arrow(), draw_background(), blender::ed::vse::draw_cache_view(), draw_channel_strips(), blender::ed::spreadsheet::draw_column_reorder_source(), draw_current_frame(), blender::ed::vse::draw_cursor_2d(), draw_fcurve(), draw_fcurve_handles(), draw_fcurve_samples(), draw_fcurve_vertices(), draw_filled_lasso(), blender::ed::vse::draw_histogram(), draw_image_cache(), draw_lasso_smooth_stroke_indicator(), draw_line_bounds(), draw_line_loop(), draw_line_pairs(), draw_marker(), draw_markers_background(), draw_mask_layers(), draw_movieclip_buffer(), draw_movieclip_cache(), draw_nla_main_data(), draw_nla_track_list(), draw_normalization_borders(), draw_overshoot_triangle(), draw_plane_marker_image(), draw_scope_end(), blender::ed::vse::draw_seq_strips(), blender::ed::vse::draw_seq_timeline_channels(), blender::ed::vse::draw_strip_in_view(), blender::ed::vse::draw_strips_background(), blender::ed::vse::draw_strips_foreground(), draw_text_decoration(), draw_text_main(), blender::ed::vse::draw_timeline_sfra_efra(), draw_tracks_motion_and_error_curves(), blender::ed::vse::draw_vectorscope_graticule(), draw_view_axis(), blender::ed::transform::drawAutoKeyWarning(), blender::ed::transform::drawEdgeSlide(), blender::ed::transform::drawLine(), blender::ed::transform::drawPropCircle(), blender::ed::transform::drawPropRange(), blender::ed::transform::drawSnapping(), blender::ed::transform::drawVertSlide(), drawviewborder(), DRW_draw_render_loop_offscreen(), blender::ed::sculpt_paint::dyntopo::dyntopo_detail_size_edit_draw(), ED_image_draw_info(), ED_mask_draw_region(), ED_region_do_draw(), ED_region_image_render_region_draw(), ED_region_info_draw_multiline(), ED_screen_draw_edges(), ED_view3d_cursor_snap_draw_util(), EDBM_preselect_edgering_draw(), file_draw_preview(), file_draw_special_image(), gizmo_axis_draw(), gizmo_button2d_draw(), gizmo_cage2d_draw_intern(), gizmo_cage3d_draw_intern(), gizmo_dial_draw(), gizmo_move_draw(), gizmo_primitive_draw_intern(), gizmo_ruler_draw(), blender::ed::sculpt_paint::image::ops::paint::gradient_draw_line(), graph_draw_channel_names(), graph_draw_ghost_curves(), graph_main_region_draw(), histogram_draw_one(), icon_draw_size(), knifetool_draw(), knifetool_draw_angle(), knifetool_draw_visible_distances(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_draw(), move3d_draw_intern(), nla_draw_strip(), nla_draw_strip_curves(), blender::ed::space_node::node_draw_collapsed(), blender::ed::space_node::node_draw_link_end_marker(), blender::ed::space_node::node_draw_mute_line(), blender::ed::space_node::node_draw_nodesocket(), blender::ed::space_node::node_draw_nodetree(), blender::ed::space_node::node_draw_preview(), blender::ed::space_node::node_draw_space(), blender::ed::space_node::node_draw_zones_and_frames(), blender::ed::space_node::nodelink_batch_draw(), blender::ed::space_node::nodesocket_batch_end(), blender::ed::outliner::outliner_draw_active_indicator(), blender::ed::outliner::outliner_draw_hierarchy_lines(), blender::ed::outliner::outliner_draw_highlights(), blender::ed::outliner::outliner_draw_tree(), blender::ed::outliner::outliner_draw_tree_element(), blender::ed::sculpt_paint::paint_cursor_restore_drawing_state(), blender::ed::sculpt_paint::paint_cursor_setup_2D_drawing(), blender::ed::sculpt_paint::paint_cursor_setup_3D_drawing(), blender::ed::sculpt_paint::paint_draw_alpha_overlay(), blender::ed::sculpt_paint::paint_draw_cursor_overlay(), blender::ed::sculpt_paint::paint_draw_curve_cursor(), blender::ed::sculpt_paint::paint_draw_smooth_cursor(), blender::ed::sculpt_paint::paint_draw_tex_overlay(), panel_draw_aligned_backdrop(), panel_draw_aligned_widgets(), playanim_toscreen_ex(), pygpu_state_blend_set(), radial_control_paint_cursor(), region_draw_azone_tab_arrow(), region_draw_azones(), region_draw_status_text(), blender::ed::greasepencil::render_strokes(), blender::ed::vse::sequencer_draw_scopes(), blender::ed::vse::sequencer_preview_draw_overlays(), stitch_draw(), blender::ed::vse::strip_draw_image_origin_and_outline(), blender::ed::vse::text_edit_draw(), textview_draw_sel(), textview_draw_string(), timeline_draw_cache(), blender::ed::transform::transform_draw_cursor_draw(), UI_block_draw(), ui_draw_but(), ui_draw_but_COLORBAND(), ui_draw_but_CURVE(), ui_draw_but_CURVEPROFILE(), ui_draw_but_HISTOGRAM(), ui_draw_but_HSVCIRCLE(), ui_draw_but_IMAGE(), ui_draw_but_TRACKPREVIEW(), ui_draw_but_UNITVEC(), ui_draw_but_VECTORSCOPE(), ui_draw_but_WAVEFORM(), ui_draw_button_sections_alignment_separator(), ui_draw_colorband_handle(), ui_draw_dropshadow(), ui_draw_menu_item(), ui_draw_pie_center(), ui_draw_popover_back_impl(), ui_draw_preview_item_stateless(), UI_draw_roundbox_4fv_ex(), ui_draw_separator(), ui_hsv_cursor(), UI_panel_category_draw_all(), ui_searchbox_draw_clip_tri_down(), ui_searchbox_draw_clip_tri_up(), ui_tooltip_region_draw_cb(), UI_widgetbase_draw_cache_end(), v3d_cursor_plane_draw_grid(), blender::ed::object::voxel_size_edit_draw(), widget_box(), widget_draw_icon(), widget_draw_node_link_socket(), widget_draw_submenu_tria(), widget_draw_text(), widget_draw_text_icon(), widget_menu_back(), widget_nodesocket(), widget_progress_type_ring(), widget_swatch(), widget_tab(), widgetbase_draw(), widgetbase_draw_color(), wm_drags_draw(), wm_draw_region_blend(), wm_gesture_draw_circle(), wm_gesture_draw_line_active_side(), wm_gesture_draw_rect(), wm_software_cursor_draw_bitmap(), wm_xr_controller_aim_draw(), and wm_xr_controller_model_draw().

◆ GPU_blend_get()

◆ GPU_clip_control_unit_range()

void GPU_clip_control_unit_range ( bool enable)

Definition at line 148 of file gpu_state.cc.

References SET_IMMUTABLE_STATE.

Referenced by blender::draw::command::StateSet::execute().

◆ GPU_clip_distances()

void GPU_clip_distances ( int distances_enabled)

◆ GPU_color_mask()

◆ GPU_depth_mask()

◆ GPU_depth_mask_get()

◆ GPU_depth_range()

◆ GPU_depth_test()

void GPU_depth_test ( GPUDepthTest test)

Definition at line 68 of file gpu_state.cc.

References SET_IMMUTABLE_STATE.

Referenced by annotation_draw_strokes(), blender::ed::curves::curve_draw_stroke_3d(), curve_draw_stroke_3d(), blender::ed::greasepencil::image_render::draw_grease_pencil_strokes(), blender::ed::space_node::draw_nodespace_back_pix(), draw_primitive_view(), blender::ed::vse::draw_timeline_pre_view_callbacks(), blender::ed::transform::drawConstraint(), blender::ed::transform::drawEdgeSlide(), blender::ed::transform::drawPropCircle(), blender::ed::transform::drawSnapping(), blender::ed::transform::drawVertSlide(), drw_callbacks_post_scene(), drw_callbacks_post_scene_2D(), DRW_render_gpencil(), EDBM_preselect_edgering_draw(), EDBM_preselect_elem_draw(), gizmo_draw_select_3d_loop(), gizmos_draw_list(), gpu_select_pick_begin(), gpu_select_pick_end(), gpu_select_query_begin(), gpu_select_query_end(), GPU_viewport_unbind_from_offscreen(), knifetool_draw(), blender::ed::space_node::node_draw_space(), blender::ed::sculpt_paint::paint_draw_alpha_overlay(), blender::ed::sculpt_paint::paint_draw_cursor_overlay(), blender::ed::sculpt_paint::paint_draw_tex_overlay(), blender::ed::vse::preview_draw_begin(), pygpu_state_depth_test_set(), blender::ed::sculpt_paint::sculpt_geometry_preview_lines_draw(), blender::ed::vse::sequencer_preview_draw_overlays(), view3d_gpu_select_ex(), view3d_main_region_draw(), wm_gizmo_geometryinfo_draw(), wm_xr_controller_aim_draw(), wm_xr_controller_model_draw(), wm_xr_raycast_destination_draw(), and wm_xr_raycast_draw().

◆ GPU_depth_test_get()

◆ GPU_face_culling()

void GPU_face_culling ( GPUFaceCullTest culling)

◆ GPU_face_culling_get()

◆ GPU_fence_create()

GPUFence * GPU_fence_create ( )

◆ GPU_fence_free()

void GPU_fence_free ( GPUFence * fence)

Definition at line 337 of file gpu_state.cc.

References blender::gpu::unwrap().

Referenced by BlenderDisplayDriver::gpu_resources_destroy().

◆ GPU_fence_signal()

void GPU_fence_signal ( GPUFence * fence)

Definition at line 342 of file gpu_state.cc.

References blender::gpu::unwrap().

Referenced by BlenderDisplayDriver::draw(), and BlenderDisplayDriver::update_end().

◆ GPU_fence_wait()

void GPU_fence_wait ( GPUFence * fence)

◆ GPU_finish()

◆ GPU_flush()

◆ GPU_front_facing()

◆ GPU_line_smooth()

void GPU_line_smooth ( bool enable)

Definition at line 78 of file gpu_state.cc.

References SET_IMMUTABLE_STATE.

Referenced by annotation_draw_data(), annotation_draw_eraser(), annotation_draw_stabilizer(), brush_drawcursor(), button2d_draw_intern(), cursor_box_draw(), blender::ed::curves::curve_draw_stroke_3d(), curve_draw_stroke_3d(), draw_fcurve(), draw_fcurve_handles(), draw_fcurve_samples(), draw_lasso_smooth_stroke_indicator(), draw_spline_curve(), draw_spline_points(), draw_view_axis(), blender::ed::sculpt_paint::dyntopo::dyntopo_detail_size_edit_draw(), ED_view3d_cursor_snap_draw_util(), gizmo_ruler_draw(), gizmos_draw_list(), blender::ed::sculpt_paint::image::ops::paint::gradient_draw_line(), graph_draw_ghost_curves(), histogram_draw_one(), nla_draw_strip_curves(), blender::ed::space_node::node_draw_space(), blender::ed::sculpt_paint::paint_cursor_restore_drawing_state(), blender::ed::sculpt_paint::paint_cursor_setup_2D_drawing(), blender::ed::sculpt_paint::paint_cursor_setup_3D_drawing(), blender::ed::sculpt_paint::paint_draw_curve_cursor(), blender::ed::sculpt_paint::paint_draw_line_cursor(), blender::ed::sculpt_paint::paint_draw_smooth_cursor(), radial_control_paint_cursor(), blender::draw::command::StateSet::set(), blender::ed::vse::strip_draw_image_origin_and_outline(), blender::ed::vse::text_edit_draw(), blender::ed::transform::transform_draw_cursor_draw(), ui_draw_but_CURVE(), ui_draw_but_CURVEPROFILE(), ui_draw_but_HSVCIRCLE(), ui_draw_but_UNITVEC(), ui_draw_but_VECTORSCOPE(), UI_panel_category_draw_all(), v3d_cursor_plane_draw_grid(), and blender::ed::object::voxel_size_edit_draw().

◆ GPU_line_smooth_get()

◆ GPU_line_width()

void GPU_line_width ( float width)
Note
By convention, this is set as needed and not reset back to 1.0. This means code that draws lines must always set the line width beforehand, but is not expected to restore its previous value.

Definition at line 166 of file gpu_state.cc.

References max_ff(), PIXELSIZE, and SET_MUTABLE_STATE.

Referenced by ANIM_channel_draw(), ANIM_draw_action_framerange(), ANIM_draw_cfra(), annotation_draw_stabilizer(), cursor_box_draw(), blender::ed::curves::curve_draw_stroke_3d(), curve_draw_stroke_3d(), blender::ed::sculpt_paint::draw_bezier_handle_lines(), draw_distortion(), draw_fcurve(), draw_fcurve_modifier_controls_envelope(), draw_frame_curves(), draw_image_uv_custom_region(), draw_lasso_smooth_stroke_indicator(), blender::ed::greasepencil::image_render::draw_lines(), draw_marker_outline(), draw_marker_slide_zones(), draw_plane_marker_ex(), blender::ed::greasepencil::image_render::draw_polyline(), blender::ed::sculpt_paint::draw_rect_point(), draw_render_info(), draw_single_handle(), draw_track_path(), blender::ed::sculpt_paint::draw_tri_point(), draw_view_axis(), blender::ed::transform::drawEdgeSlide(), drawrenderborder(), blender::ed::transform::drawTransformView(), blender::ed::transform::drawVertSlide(), drawviewborder(), blender::ed::sculpt_paint::dyntopo::dyntopo_detail_size_edit_draw(), ED_image_draw_cursor(), ED_imbuf_sample_draw(), ED_markers_draw(), ED_region_do_draw(), ED_region_draw_mouse_line_cb(), ED_region_panels_draw(), ED_view3d_cursor_snap_draw_util(), EDBM_preselect_elem_draw(), blender::ed::sculpt_paint::boundary::edges_preview_draw(), gizmo_ruler_draw(), blender::ed::sculpt_paint::image::ops::paint::gradient_draw_line(), graph_draw_driver_debug(), graph_draw_ghost_curves(), graph_main_region_draw(), blender::ed::sculpt_paint::grease_pencil_brush_cursor_draw(), histogram_draw_one(), knife_draw_line(), knifetool_draw(), knifetool_draw_angle(), mask_draw_curve_type(), nla_draw_use_dashed_outlines(), nla_strip_draw_markers(), blender::ed::space_node::node_draw_basis(), blender::ed::outliner::outliner_draw_hierarchy_lines(), blender::ed::outliner::outliner_draw_separator(), blender::ed::sculpt_paint::paint_cursor_draw_main_inactive_cursor(), blender::ed::sculpt_paint::paint_cursor_pose_brush_segments_draw(), blender::ed::sculpt_paint::paint_cursor_setup_2D_drawing(), blender::ed::sculpt_paint::paint_cursor_setup_3D_drawing(), blender::ed::sculpt_paint::paint_draw_2D_view_brush_cursor_default(), blender::ed::sculpt_paint::paint_draw_3D_view_inactive_brush_cursor(), blender::ed::sculpt_paint::paint_draw_curve_cursor(), blender::ed::sculpt_paint::paint_draw_legacy_3D_view_brush_cursor(), blender::ed::sculpt_paint::boundary::pivot_line_preview_draw(), blender::ed::sculpt_paint::cloth::plane_falloff_preview_draw(), pygpu_state_line_width_set(), radial_control_paint_cursor(), radial_control_paint_curve(), region_draw_azones(), blender::ed::sculpt_paint::sculpt_geometry_preview_lines_draw(), blender::ed::sculpt_paint::SCULPT_layer_brush_height_preview_draw(), blender::ed::vse::sequencer_draw_borders_overlay(), blender::draw::command::StateSet::set(), blender::ed::sculpt_paint::cloth::simulation_limits_draw(), blender::ed::vse::strip_draw_image_origin_and_outline(), tracking_segment_knot_cb(), tracking_segment_start_cb(), blender::ed::transform::transform_draw_cursor_draw(), ui_draw_but_CURVE(), ui_draw_but_CURVEPROFILE(), ui_draw_but_VECTORSCOPE(), ui_draw_separator(), UI_view2d_multi_grid_draw(), v3d_cursor_plane_draw_grid(), blender::ed::object::voxel_size_edit_draw(), and wm_gesture_draw().

◆ GPU_line_width_get()

float GPU_line_width_get ( )

◆ GPU_logic_op_xor_set()

void GPU_logic_op_xor_set ( bool enable)

Definition at line 88 of file gpu_state.cc.

References SET_IMMUTABLE_STATE.

Referenced by draw_marker_areas(), draw_stabilization_border(), and ED_imbuf_sample_draw().

◆ GPU_memory_barrier()

void GPU_memory_barrier ( GPUBarrier barrier)

A barrier must be issued after a shader arbitrary write to a buffer or a texture (i.e: using imageStore, imageAtomics, or SSBO). Otherwise, the written value may not appear updated to the next user of this resource.

The type of barrier must be chosen depending on the future use of the memory that was written by the shader.

Definition at line 326 of file gpu_state.cc.

References blender::gpu::Context::get(), blender::gpu::StateManager::issue_barrier(), and blender::gpu::Context::state_manager.

Referenced by blender::nodes::node_composite_glare_cc::GlareOperation::accumulate_ghosts_gpu(), blender::nodes::node_composite_file_output_cc::FileOutputOperation::add_pass_for_result(), blender::nodes::node_composite_file_output_cc::FileOutputOperation::add_view_for_result(), blender::nodes::node_composite_glare_cc::GlareOperation::apply_streak_filter_gpu(), blender::compositor::Result::bind_as_image(), blender::compositor::Result::bind_as_texture(), blender::gpu::tests::blend_test(), blender::nodes::node_composite_vec_blur_cc::VectorBlurOperation::compute_motion_blur(), blender::compositor::compute_preview_gpu(), blender::draw::View::compute_procedural_bounds(), blender::draw::View::compute_visibility(), blender::draw::Manager::debug_bind(), blender::compositor::Result::download_to_cpu(), blender::draw::draw_subdiv_accumulate_normals(), blender::draw::draw_subdiv_build_edge_fac_buffer(), blender::draw::draw_subdiv_build_edituv_stretch_angle_buffer(), blender::draw::draw_subdiv_build_edituv_stretch_area_buffer(), blender::draw::draw_subdiv_build_fdots_buffers(), blender::draw::draw_subdiv_build_lines_buffer(), blender::draw::draw_subdiv_build_lines_loose_buffer(), blender::draw::draw_subdiv_build_lnor_buffer(), blender::draw::draw_subdiv_build_paint_overlay_flag_buffer(), blender::draw::draw_subdiv_build_sculpt_data_buffer(), blender::draw::draw_subdiv_build_tris_buffer(), blender::draw::draw_subdiv_extract_pos(), blender::draw::draw_subdiv_extract_uvs(), blender::draw::draw_subdiv_interp_corner_normals(), blender::draw::draw_subdiv_interp_custom_data(), blender::draw::DRW_curves_update(), blender::draw::Manager::end_sync(), blender::draw::command::Barrier::execute(), blender::nodes::node_composite_denoise_cc::DenoiseOperation::execute(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_fog_glow(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_anti_diagonal_pass_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_diagonal_pass_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_horizontal_pass_gpu(), blender::nodes::node_composite_glare_cc::GlareOperation::execute_simple_star_vertical_pass_gpu(), blender::draw::command::DrawMultiBuf::generate_commands(), GPU_indexbuf_build_curves_on_device(), ViewportColorSampleSession::init(), blender::render::Context::output_to_render_result(), blender::compositor::parallel_reduction_dispatch(), pygpu_compute_dispatch(), blender::eevee::Film::read_aov(), blender::gpu::tests::CallData::read_back(), blender::eevee::Film::read_pass(), blender::draw::select::SelectMap::read_result(), blender::eevee::IrradianceBake::read_result_packed(), blender::eevee::IrradianceBake::read_result_unpacked(), blender::eevee::DepthOfField::render(), blender::compositor::sample_pixel_gpu(), blender::ed::vse::sequencer_draw_scopes(), blender::eevee::ShadowModule::set_view(), blender::draw::Manager::submit_debug(), blender::eevee::IrradianceBake::surfels_create(), blender::gpu::tests::test_buffer_texture(), blender::gpu::tests::test_compute_direct(), blender::gpu::tests::test_compute_indirect(), blender::draw::test_eevee_shadow_page_mask_ex(), blender::gpu::tests::test_shader_compute_1d(), blender::gpu::tests::test_shader_compute_2d(), blender::gpu::tests::test_shader_compute_ibo(), blender::gpu::tests::test_shader_compute_ssbo(), blender::gpu::tests::test_shader_compute_vbo(), blender::gpu::tests::test_texture_1d(), blender::gpu::tests::test_texture_1d_array(), blender::gpu::tests::test_texture_1d_array_upload(), blender::gpu::tests::test_texture_2d_array(), blender::gpu::tests::test_texture_2d_array_upload(), blender::gpu::tests::test_texture_3d(), blender::gpu::tests::test_texture_copy(), blender::gpu::tests::test_texture_cube(), blender::gpu::tests::test_texture_read(), blender::gpu::tests::ShaderSpecializationConst::validate(), and blender::render::Context::viewer_output_to_viewer_image().

◆ GPU_mipmap_enabled()

bool GPU_mipmap_enabled ( )

◆ GPU_point_size()

◆ GPU_polygon_smooth()

◆ GPU_program_point_size()

◆ GPU_provoking_vertex()

void GPU_provoking_vertex ( GPUProvokingVertex vert)

Definition at line 63 of file gpu_state.cc.

References SET_IMMUTABLE_STATE.

◆ GPU_scissor()

◆ GPU_scissor_get()

◆ GPU_scissor_test()

◆ GPU_shadow_offset()

void GPU_shadow_offset ( bool enable)

Definition at line 119 of file gpu_state.cc.

References SET_IMMUTABLE_STATE.

Referenced by blender::draw::command::StateSet::execute().

◆ GPU_state_set()

void GPU_state_set ( GPUWriteMask write_mask,
GPUBlend blend,
GPUFaceCullTest culling_test,
GPUDepthTest depth_test,
GPUStencilTest stencil_test,
GPUStencilOp stencil_op,
GPUProvokingVertex provoking_vert )

◆ GPU_stencil_compare_mask_set()

void GPU_stencil_compare_mask_set ( uint compare_mask)

Definition at line 215 of file gpu_state.cc.

References SET_MUTABLE_STATE.

Referenced by blender::draw::command::StencilSet::execute().

◆ GPU_stencil_mask_get()

◆ GPU_stencil_reference_set()

void GPU_stencil_reference_set ( uint reference)

Definition at line 205 of file gpu_state.cc.

References SET_MUTABLE_STATE.

Referenced by blender::draw::command::StencilSet::execute().

◆ GPU_stencil_test()

void GPU_stencil_test ( GPUStencilTest test)

Definition at line 73 of file gpu_state.cc.

References SET_IMMUTABLE_STATE.

Referenced by blender::gpu::GLFrameBuffer::clear().

◆ GPU_stencil_test_get()

◆ GPU_stencil_write_mask_set()

void GPU_stencil_write_mask_set ( uint write_mask)

◆ GPU_viewport()

◆ GPU_viewport_size_get_f()

void GPU_viewport_size_get_f ( float coords[4])

Definition at line 273 of file gpu_state.cc.

References blender::gpu::Context::active_fb, blender::gpu::Context::get(), i, and blender::gpu::FrameBuffer::viewport_get().

Referenced by annotation_draw_eraser(), annotation_draw_stroke_2d(), annotation_draw_stroke_3d(), annotation_draw_stroke_buffer(), arrow_draw_geom(), button2d_draw_intern(), button2d_geom_draw_backdrop(), cage2d_draw_box_corners(), cage2d_draw_box_interaction(), cage2d_draw_circle_wire(), cage2d_draw_rect_wire(), cage3d_draw_box_corners(), cage3d_draw_circle_wire(), dial_geom_draw(), dial_ghostarc_draw_helpline(), dial_ghostarc_draw_incremental_angle(), blender::ed::vse::draw_cursor_2d(), draw_fcurve(), draw_fcurve_modifier_controls_envelope(), draw_image_sample_line(), draw_image_uv_custom_region(), draw_line_bounds(), draw_line_loop(), draw_line_pairs(), draw_marker_areas(), draw_marker_line(), blender::ed::vse::draw_overlap_frame_indicator(), draw_parallel_lines(), draw_plane_marker_ex(), draw_stabilization_border(), blender::ed::transform::drawConstraint(), blender::ed::transform::drawLine(), blender::ed::transform::drawPropCircle(), blender::ed::transform::drawPropRange(), drawrenderborder(), blender::ed::transform::drawVertSlide(), drawviewborder(), ED_image_draw_cursor(), ED_region_draw_mouse_line_cb(), ED_view3d_cursor_snap_draw_util(), EDBM_preselect_edgering_draw(), gizmo_axis_draw(), gizmo_primitive_draw_geom(), gizmo_ruler_draw(), gpu_select_pick_begin(), graph_draw_driver_debug(), graph_draw_ghost_curves(), blender::ed::sculpt_paint::grease_pencil_eraser_draw(), mask_draw_curve_type(), move_geom_draw(), nla_actionclip_draw_markers(), nla_draw_use_dashed_outlines(), blender::ed::space_node::node_draw_zones_and_frames(), blender::ed::outliner::outliner_draw_hierarchy_lines(), blender::ed::sculpt_paint::paint_draw_line_cursor(), blender::ed::vse::sequencer_draw_borders_overlay(), blender::ed::transform::transform_draw_cursor_draw(), ui_draw_colorband_handle(), wide_line_workaround_start(), wm_gesture_draw_circle(), wm_gesture_draw_cross(), wm_gesture_draw_lasso(), wm_gesture_draw_line(), wm_gesture_draw_polyline(), wm_gesture_draw_rect(), and wm_xr_controller_aim_draw().

◆ GPU_viewport_size_get_i()

◆ GPU_write_mask()

◆ GPU_write_mask_get()