109 viewport->
size[0] = viewport->
size[1] = -1;
129 float const empty_pixel[4] = {0.0f, 0.0f, 0.0f, 0.0f};
164 if (viewport->
depth_tx ==
nullptr) {
174 const int depth_clear = 0;
189 for (
int i = 0;
i < 2;
i++) {
217 GPUTexture *color, *depth;
228 if (!is_xr_surface) {
273 viewport->
dither = dither;
291 GPU_ATTACHMENT_TEXTURE(viewport->color_overlay_tx[0]),
292 GPU_ATTACHMENT_TEXTURE(viewport->color_render_tx[0]),
367 const uint vbo_len = 4;
395 const rctf *rect_pos,
398 const float compare_limit = 0.0001f;
399 const bool parameters_changed =
404 if (viewport->
batch.
batch && parameters_changed) {
429 const rctf *rect_pos,
431 bool display_colorspace,
432 bool do_overlay_merge)
437 bool use_ocio =
false;
483 bool display_colorspace,
484 bool do_overlay_merge)
488 if (color ==
nullptr) {
496 rcti sanitized_rect = *rect;
507 pos_rect.
xmin = sanitized_rect.
xmin;
508 pos_rect.
ymin = sanitized_rect.
ymin;
510 pos_rect.
ymax = sanitized_rect.
ymin + h;
513 uv_rect.
xmin = halfx;
514 uv_rect.
ymin = halfy;
515 uv_rect.
xmax = halfx + 1.0f;
516 uv_rect.
ymax = halfy + 1.0f;
521 std::swap(uv_rect.
xmin, uv_rect.
xmax);
524 std::swap(uv_rect.
ymin, uv_rect.
ymax);
528 viewport,
view, &pos_rect, &uv_rect, display_colorspace, do_overlay_merge);
538 bool display_colorspace,
539 bool do_overlay_merge)
551 pos_rect.
xmin = -1.0f;
552 pos_rect.
ymin = -1.0f;
553 pos_rect.
xmax = 1.0f;
554 pos_rect.
ymax = 1.0f;
563 viewport,
view, &pos_rect, &uv_rect, display_colorspace, do_overlay_merge);
605 GPU_ATTACHMENT_TEXTURE(viewport->depth_tx),
606 GPU_ATTACHMENT_TEXTURE(viewport->color_render_tx[viewport->active_view]),
616 GPU_ATTACHMENT_TEXTURE(viewport->depth_tx),
617 GPU_ATTACHMENT_TEXTURE(viewport->color_overlay_tx[viewport->active_view]),
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])
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)
@ COLORMANAGE_VIEW_USE_HDR
@ S3D_ANAGLYPH_YELLOWBLUE
@ S3D_ANAGLYPH_GREENMAGENTA
void DRW_gpu_context_disable()
void DRW_gpu_context_enable()
void DRW_viewport_data_free(DRWData *drw_data)
blender::gpu::Batch * GPU_batch_create_ex(GPUPrimType primitive_type, blender::gpu::VertBuf *vertex_buf, blender::gpu::IndexBuf *index_buf, eGPUBatchFlag owns_flag)
void GPU_batch_discard(blender::gpu::Batch *batch)
void GPU_batch_program_set_imm_shader(blender::gpu::Batch *batch)
void GPU_batch_program_set_builtin(blender::gpu::Batch *batch, eGPUBuiltinShader shader_id)
void GPU_batch_draw(blender::gpu::Batch *batch)
#define GPU_batch_uniform_1i(batch, name, x)
#define GPU_FRAMEBUFFER_FREE_SAFE(fb)
int GPU_offscreen_width(const GPUOffScreen *offscreen)
void GPU_offscreen_bind(GPUOffScreen *offscreen, bool save)
void GPU_offscreen_viewport_data_get(GPUOffScreen *offscreen, GPUFrameBuffer **r_fb, GPUTexture **r_color, GPUTexture **r_depth)
void GPU_framebuffer_restore()
int GPU_offscreen_height(const GPUOffScreen *offscreen)
void GPU_framebuffer_bind(GPUFrameBuffer *fb)
#define GPU_framebuffer_ensure_config(_fb,...)
void GPU_matrix_identity_projection_set()
void GPU_matrix_identity_set()
void GPU_matrix_push_projection()
void GPU_matrix_pop_projection()
@ 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 *texture)
void GPU_texture_bind(GPUTexture *texture, int unit)
GPUTexture * GPU_texture_create_2d(const char *name, int width, int height, int mip_len, eGPUTextureFormat format, eGPUTextureUsage usage, const float *data)
int GPU_texture_width(const GPUTexture *texture)
void GPU_texture_clear(GPUTexture *texture, eGPUDataFormat data_format, const void *data)
void GPU_texture_unbind(GPUTexture *texture)
@ GPU_TEXTURE_USAGE_SHADER_READ
@ GPU_TEXTURE_USAGE_SHADER_WRITE
@ GPU_TEXTURE_USAGE_HOST_READ
@ GPU_TEXTURE_USAGE_ATTACHMENT
@ GPU_TEXTURE_USAGE_FORMAT_VIEW
#define GPU_TEXTURE_FREE_SAFE(texture)
void GPU_vertbuf_attr_get_raw_data(blender::gpu::VertBuf *, uint a_idx, GPUVertBufRaw *access)
GPU_INLINE void * GPU_vertbuf_raw_step(GPUVertBufRaw *a)
#define GPU_vertbuf_create_with_format(format)
void GPU_vertbuf_data_alloc(blender::gpu::VertBuf &verts, uint v_len)
void IMB_colormanagement_finish_glsl_draw()
bool IMB_colormanagement_setup_glsl_draw_from_space(const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, const ColorSpace *from_colorspace, float dither, bool predivide, bool do_overlay_merge)
Read Guarded memory(de)allocation.
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
struct @242053044010324116347033273112253060004051364061::@373043131300025057314200265134167265161140142363 attr_id
struct @242053044010324116347033273112253060004051364061::@051143074301336237271216303350234260141112266062 batch
void GPU_viewport_bind(GPUViewport *viewport, int view, const rcti *rect)
GPUTexture * GPU_viewport_color_texture(GPUViewport *viewport, int view)
void GPU_viewport_unbind(GPUViewport *)
static const GPUVertFormat & gpu_viewport_batch_format()
void GPU_viewport_unbind_from_offscreen(GPUViewport *viewport, GPUOffScreen *ofs, bool display_colorspace, bool do_overlay_merge)
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)
GPUViewport * GPU_viewport_create()
GPUViewport * GPU_viewport_stereo_create()
static blender::gpu::Batch * gpu_viewport_batch_create(const rctf *rect_pos, const rctf *rect_uv)
static struct @205365341300264070236363157302166140270074174361 g_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)
void GPU_viewport_bind_from_offscreen(GPUViewport *viewport, GPUOffScreen *ofs, bool is_xr_surface)
static void gpu_viewport_textures_create(GPUViewport *viewport)
bool GPU_viewport_is_stereo_get(GPUViewport *viewport)
bool GPU_viewport_do_update(GPUViewport *viewport)
static blender::gpu::Batch * gpu_viewport_batch_get(GPUViewport *viewport, const rctf *rect_pos, const rctf *rect_uv)
int GPU_viewport_active_view_get(GPUViewport *viewport)
static void gpu_viewport_textures_free(GPUViewport *viewport)
void GPU_viewport_free(GPUViewport *viewport)
GPUTexture * GPU_viewport_depth_texture(GPUViewport *viewport)
void GPU_viewport_colorspace_set(GPUViewport *viewport, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, float dither)
void GPU_viewport_stereo_composite(GPUViewport *viewport, Stereo3dFormat *stereo_format)
static void gpu_viewport_batch_free(GPUViewport *viewport)
void GPU_viewport_tag_update(GPUViewport *viewport)
GPUFrameBuffer * GPU_viewport_framebuffer_overlay_get(GPUViewport *viewport)
GPUTexture * GPU_viewport_overlay_texture(GPUViewport *viewport, int view)
GPUFrameBuffer * GPU_viewport_framebuffer_render_get(GPUViewport *viewport)
DRWData ** GPU_viewport_data_get(GPUViewport *viewport)
BLI_INLINE float fb(float length, float L)
void * MEM_callocN(size_t len, const char *str)
void MEM_freeN(void *vmemh)
VecBase< int32_t, 2 > int2
ccl_device_inline int rect_size(const int4 rect)
struct CurveMapping * curve_mapping
blender::gpu::Batch * batch
struct GPUViewportBatch::@352030103322200053217325036066152160214055240116 last_used_parameters
GPUFrameBuffer * overlay_fb
ColorManagedViewSettings view_settings
ColorManagedDisplaySettings display_settings
GPUTexture * color_overlay_tx[2]
GPUTexture * color_render_tx[2]
GPUFrameBuffer * stereo_comp_fb
CurveMapping * orig_curve_mapping
GPUFrameBuffer * render_fb