102 viewport->
size[0] = viewport->
size[1] = -1;
122 float empty_pixel[4] = {0.0f, 0.0f, 0.0f, 0.0f};
160 GPU_FRAMEBUFFER_FREE_SAFE(viewport->
overlay_fb);
162 for (
int i = 0; i < 2; i++) {
203 if (!is_xr_surface) {
255 viewport->
dither = dither;
267 GPU_framebuffer_ensure_config(
273 GPU_ATTACHMENT_TEXTURE(viewport->color_overlay_tx[0]),
274 GPU_ATTACHMENT_TEXTURE(viewport->color_render_tx[0]),
349 const uint vbo_len = 4;
369 const rctf *rect_pos,
372 const float compare_limit = 0.0001f;
373 const bool parameters_changed =
378 if (viewport->
batch.
batch && parameters_changed) {
403 const rctf *rect_pos,
405 bool display_colorspace,
406 bool do_overlay_merge)
411 bool use_ocio =
false;
454 bool display_colorspace,
455 bool do_overlay_merge)
467 rcti sanitized_rect = *rect;
474 const float halfx = GLA_PIXEL_OFS /
w;
475 const float halfy = GLA_PIXEL_OFS / h;
479 .ymin = sanitized_rect.
ymin,
480 .xmax = sanitized_rect.
xmin +
w,
481 .ymax = sanitized_rect.
ymin + h,
487 .xmax = halfx + 1.0f,
488 .ymax = halfy + 1.0f,
500 viewport,
view, &pos_rect, &uv_rect, display_colorspace, do_overlay_merge);
510 bool display_colorspace,
511 bool do_overlay_merge)
537 viewport,
view, &pos_rect, &uv_rect, display_colorspace, do_overlay_merge);
576 GPU_framebuffer_ensure_config(
579 GPU_ATTACHMENT_TEXTURE(viewport->depth_tx),
580 GPU_ATTACHMENT_TEXTURE(viewport->color_overlay_tx[viewport->active_view]),
typedef float(TangentPoint)[2]
MINLINE void copy_v2_fl2(float v[2], float x, float y)
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
MINLINE bool equals_v2v2_int(const int v1[2], const int v2[2]) ATTR_WARN_UNUSED_RESULT
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
void BLI_rcti_sanitize(struct rcti *rect)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
bool BLI_rctf_compare(const struct rctf *rect_a, const struct rctf *rect_b, float limit)
#define SET_FLAG_FROM_TEST(value, test, flag)
@ S3D_ANAGLYPH_YELLOWBLUE
@ S3D_ANAGLYPH_GREENMAGENTA
void DRW_opengl_context_enable(void)
void DRW_viewport_data_free(struct DRWData *drw_data)
void DRW_opengl_context_disable(void)
void GPU_batch_discard(GPUBatch *)
void GPU_batch_program_set_imm_shader(GPUBatch *batch)
void GPU_batch_program_set_builtin(GPUBatch *batch, eGPUBuiltinShader shader_id)
GPUBatch * GPU_batch_create_ex(GPUPrimType prim, GPUVertBuf *vert, GPUIndexBuf *elem, eGPUBatchFlag owns_flag)
void GPU_batch_draw(GPUBatch *batch)
#define GPU_batch_uniform_1i(batch, name, x)
bool GPU_clear_viewport_workaround(void)
struct GPUFrameBuffer GPUFrameBuffer
void GPU_framebuffer_restore(void)
void GPU_framebuffer_bind(GPUFrameBuffer *fb)
void GPU_matrix_pop(void)
void GPU_matrix_identity_projection_set(void)
void GPU_matrix_pop_projection(void)
void GPU_matrix_push(void)
void GPU_matrix_identity_set(void)
void GPU_matrix_push_projection(void)
@ GPU_SHADER_2D_IMAGE_OVERLAYS_STEREO_MERGE
@ GPU_SHADER_2D_IMAGE_OVERLAYS_MERGE
void GPU_color_mask(bool r, bool g, bool b, bool a)
void GPU_depth_test(eGPUDepthTest test)
int GPU_texture_height(const GPUTexture *tex)
void GPU_texture_clear(GPUTexture *tex, eGPUDataFormat data_format, const void *data)
struct GPUTexture GPUTexture
int GPU_texture_width(const GPUTexture *tex)
void GPU_texture_unbind(GPUTexture *tex)
GPUTexture * GPU_texture_create_2d(const char *name, int w, int h, int mip_len, eGPUTextureFormat format, const float *data)
#define GPU_TEXTURE_FREE_SAFE(texture)
void GPU_texture_bind(GPUTexture *tex, int unit)
#define GPU_vertbuf_create_with_format(format)
struct GPUVertBuf GPUVertBuf
void GPU_vertbuf_data_alloc(GPUVertBuf *, uint v_len)
GPU_INLINE void * GPU_vertbuf_raw_step(GPUVertBufRaw *a)
void GPU_vertbuf_attr_get_raw_data(GPUVertBuf *, uint a_idx, GPUVertBufRaw *access)
void IMB_colormanagement_finish_glsl_draw(void)
bool IMB_colormanagement_setup_glsl_draw_from_space(const struct ColorManagedViewSettings *view_settings, const struct ColorManagedDisplaySettings *display_settings, struct ColorSpace *colorspace, float dither, bool predivide, bool do_overlay_merge)
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
depth_tx normal_tx diffuse_light_tx specular_light_tx volume_light_tx environment_tx ambient_occlusion_tx aov_value_tx in_weight_img GPU_RGBA16F
void GPU_offscreen_viewport_data_get(GPUOffScreen *ofs, GPUFrameBuffer **r_fb, GPUTexture **r_color, GPUTexture **r_depth)
int GPU_offscreen_width(const GPUOffScreen *ofs)
void GPU_offscreen_bind(GPUOffScreen *ofs, bool save)
int GPU_offscreen_height(const GPUOffScreen *ofs)
void GPU_viewport_bind(GPUViewport *viewport, int view, const rcti *rect)
struct @680::@683 attr_id
void GPU_viewport_colorspace_set(GPUViewport *viewport, ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, float dither)
GPUTexture * GPU_viewport_color_texture(GPUViewport *viewport, int view)
void GPU_viewport_draw_to_screen(GPUViewport *viewport, int view, const rcti *rect)
void GPU_viewport_draw_to_screen_ex(GPUViewport *viewport, int view, const rcti *rect, bool display_colorspace, bool do_overlay_merge)
void GPU_viewport_bind_from_offscreen(GPUViewport *viewport, struct GPUOffScreen *ofs, bool is_xr_surface)
GPUViewport * GPU_viewport_create(void)
GPUFrameBuffer * GPU_viewport_framebuffer_overlay_get(GPUViewport *viewport)
static void gpu_viewport_draw_colormanaged(GPUViewport *viewport, int view, const rctf *rect_pos, const rctf *rect_uv, bool display_colorspace, bool do_overlay_merge)
static void gpu_viewport_textures_create(GPUViewport *viewport)
static GPUBatch * gpu_viewport_batch_create(const rctf *rect_pos, const rctf *rect_uv)
bool GPU_viewport_is_stereo_get(GPUViewport *viewport)
bool GPU_viewport_do_update(GPUViewport *viewport)
void GPU_viewport_unbind_from_offscreen(GPUViewport *viewport, struct GPUOffScreen *ofs, bool display_colorspace, bool do_overlay_merge)
GPUViewport * GPU_viewport_stereo_create(void)
int GPU_viewport_active_view_get(GPUViewport *viewport)
static void gpu_viewport_textures_free(GPUViewport *viewport)
void GPU_viewport_free(GPUViewport *viewport)
struct DRWData ** GPU_viewport_data_get(GPUViewport *viewport)
static struct @680 g_viewport
void GPU_viewport_stereo_composite(GPUViewport *viewport, Stereo3dFormat *stereo_format)
static void gpu_viewport_batch_free(GPUViewport *viewport)
GPUTexture * GPU_viewport_overlay_texture(GPUViewport *viewport, int view)
void GPU_viewport_tag_update(GPUViewport *viewport)
void GPU_viewport_unbind(GPUViewport *UNUSED(viewport))
static GPUBatch * gpu_viewport_batch_get(GPUViewport *viewport, const rctf *rect_pos, const rctf *rect_uv)
GPUTexture * GPU_viewport_depth_texture(GPUViewport *viewport)
static GPUVertFormat * gpu_viewport_batch_format(void)
BLI_INLINE float fb(float length, float L)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
ccl_device_inline int rect_size(int4 rect)
struct CurveMapping * curve_mapping
struct GPUViewportBatch::@682 last_used_parameters
GPUFrameBuffer * overlay_fb
ColorManagedViewSettings view_settings
struct GPUViewportBatch batch
ColorManagedDisplaySettings display_settings
GPUTexture * color_overlay_tx[2]
GPUTexture * color_render_tx[2]
struct DRWData * draw_data
GPUFrameBuffer * stereo_comp_fb
CurveMapping * orig_curve_mapping