54 #define MAX_ENABLE_ENGINE 8
59 #define MAX_ENGINE_BUFFER_SHARING 5
151 viewport->
size[0] = viewport->
size[1] = -1;
189 GPU_framebuffer_ensure_config(&dfbl->
default_fb,
191 GPU_ATTACHMENT_TEXTURE(dtxl->depth),
192 GPU_ATTACHMENT_TEXTURE(dtxl->color),
195 GPU_framebuffer_ensure_config(&dfbl->
overlay_fb,
197 GPU_ATTACHMENT_TEXTURE(dtxl->depth),
198 GPU_ATTACHMENT_TEXTURE(dtxl->color_overlay),
203 GPU_ATTACHMENT_TEXTURE(dtxl->depth),
210 GPU_ATTACHMENT_TEXTURE(dtxl->color),
216 GPU_ATTACHMENT_TEXTURE(dtxl->color_overlay),
225 int fbl_len, txl_len, psl_len, stl_len;
229 data->engine_type = engine_type;
251 BLI_assert(!
"Too many draw engines enabled at the same time");
257 int fbl_len, txl_len, psl_len, stl_len;
279 if (
data->text_draw_cache) {
328 return viewport->
fbl;
333 return viewport->
txl;
371 if (tmp_tex->user[i] == engine) {
375 if (tmp_tex->user[i] ==
NULL) {
376 tmp_tex->user[i] = engine;
377 return tmp_tex->texture;
391 tmp_tex->
user[0] = engine;
402 tmp_tex_next = tmp_tex->
next;
405 if (tmp_tex->user[i] !=
NULL) {
498 int fbl_len, txl_len;
599 viewport->
dither = dither;
619 GPU_ATTACHMENT_TEXTURE(dtxl->color_overlay),
620 GPU_ATTACHMENT_TEXTURE(dtxl->color),
697 const uint vbo_len = 4;
717 const rctf *rect_pos,
720 const float compare_limit = 0.0001f;
721 const bool parameters_changed =
726 if (viewport->
batch.
batch && parameters_changed) {
750 const rctf *rect_pos,
752 bool display_colorspace,
753 bool do_overlay_merge)
759 bool use_ocio =
false;
808 bool display_colorspace,
809 bool do_overlay_merge)
824 rcti sanitized_rect = *rect;
831 const float halfx = GLA_PIXEL_OFS /
w;
832 const float halfy = GLA_PIXEL_OFS / h;
836 .ymin = sanitized_rect.
ymin,
837 .xmax = sanitized_rect.
xmin +
w,
838 .ymax = sanitized_rect.
ymin + h,
844 .xmax = halfx + 1.0f,
845 .ymax = halfy + 1.0f,
857 viewport, &pos_rect, &uv_rect, display_colorspace, do_overlay_merge);
877 bool display_colorspace,
878 bool do_overlay_merge)
905 viewport, &pos_rect, &uv_rect, display_colorspace, do_overlay_merge);
936 for (
int i = 0; i < fbl_len; i++) {
943 for (
int i = 0; i < txl_len; i++) {
950 if (txl_stereo !=
NULL) {
951 for (
int i = 0; i < txl_len; i++) {
963 for (
int i = 0; i < stl_len; i++) {
964 void *storage = stl->
storage[i];
typedef float(TangentPoint)[2]
#define LISTBASE_FOREACH(type, var, list)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
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
void BLI_memblock_destroy(BLI_memblock *mblk, MemblockValFreeFP free_callback) ATTR_NONNULL(1)
void BLI_memblock_iternew(BLI_memblock *mblk, BLI_memblock_iter *iter) ATTR_NONNULL()
void * BLI_memblock_iterstep(BLI_memblock_iter *iter) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
bool BLI_rctf_compare(const struct rctf *rect_a, const struct rctf *rect_b, const float limit)
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)
#define SET_FLAG_FROM_TEST(value, test, flag)
@ S3D_ANAGLYPH_YELLOWBLUE
@ S3D_ANAGLYPH_GREENMAGENTA
void DRW_opengl_context_enable(void)
void DRW_instance_data_list_free(struct DRWInstanceDataList *idatalist)
void DRW_uniform_attrs_pool_free(struct GHash *table)
void DRW_opengl_context_disable(void)
void DRW_engine_viewport_data_size_get(const void *engine_type, int *r_fbl_len, int *r_txl_len, int *r_psl_len, int *r_stl_len)
struct DRWInstanceDataList * DRW_instance_data_list_create(void)
struct DefaultFramebufferList DefaultFramebufferList
struct DefaultTextureList DefaultTextureList
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)
struct GPUFrameBuffer GPUFrameBuffer
bool GPU_framebuffer_check_valid(GPUFrameBuffer *fb, char err_out[256])
void GPU_framebuffer_restore(void)
void GPU_framebuffer_free(GPUFrameBuffer *fb)
void GPU_framebuffer_bind(GPUFrameBuffer *fb)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
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)
struct GPUTexture GPUTexture
int GPU_texture_width(const GPUTexture *tex)
bool GPU_texture_integer(const GPUTexture *tex)
void GPU_texture_free(GPUTexture *tex)
void GPU_texture_filter_mode(GPUTexture *tex, bool use_filter)
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)
eGPUTextureFormat GPU_texture_format(const GPUTexture *tex)
bool GPU_texture_depth(const GPUTexture *tex)
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.
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
void DRW_text_cache_destroy(struct DRWTextStore *dt)
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)
double * GPU_viewport_cache_time_get(GPUViewport *viewport)
static void gpu_viewport_texture_pool_free(GPUViewport *viewport)
struct @640::@643 attr_id
void GPU_viewport_bind(GPUViewport *viewport, int view, const rcti *rect)
static void gpu_viewport_storage_free(StorageList *stl, int stl_len)
static void gpu_viewport_texture_pool_clear_users(GPUViewport *viewport)
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_active_view_set(GPUViewport *viewport, int view)
void GPU_viewport_colorspace_set(GPUViewport *viewport, ColorManagedViewSettings *view_settings, ColorManagedDisplaySettings *display_settings, float dither)
void GPU_viewport_draw_to_screen_ex(GPUViewport *viewport, int view, const rcti *rect, bool display_colorspace, bool do_overlay_merge)
static void gpu_viewport_buffers_free(FramebufferList *fbl, int fbl_len, TextureList *txl, TextureList *txl_stereo, int txl_len)
static void gpu_viewport_passes_free(PassList *psl, int psl_len)
void * GPU_viewport_engine_data_get(GPUViewport *viewport, void *engine_handle)
struct DRWInstanceDataList * GPU_viewport_instance_data_list_get(GPUViewport *viewport)
GPUTexture * GPU_viewport_texture_pool_query(GPUViewport *viewport, void *engine, int width, int height, int format)
bool GPU_viewport_engines_data_validate(GPUViewport *viewport, void **engine_handle_array)
GPUViewport * GPU_viewport_create(void)
GPUFrameBuffer * GPU_viewport_framebuffer_overlay_get(GPUViewport *viewport)
static GPUBatch * gpu_viewport_batch_create(const rctf *rect_pos, const rctf *rect_uv)
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)
static void gpu_viewport_framebuffer_view_set(GPUViewport *viewport, int view)
GPUViewport * GPU_viewport_stereo_create(void)
void * GPU_viewport_texture_list_get(GPUViewport *viewport)
static void gpu_viewport_default_fb_create(GPUViewport *viewport)
static const int default_fbl_len
void GPU_viewport_bind_from_offscreen(GPUViewport *viewport, struct GPUOffScreen *ofs)
void GPU_viewport_free(GPUViewport *viewport)
struct ViewportTempTexture ViewportTempTexture
static const int default_txl_len
void GPU_viewport_stereo_composite(GPUViewport *viewport, Stereo3dFormat *stereo_format)
static void gpu_viewport_batch_free(GPUViewport *viewport)
#define MAX_ENABLE_ENGINE
GPUFrameBuffer * GPU_viewport_framebuffer_default_get(GPUViewport *viewport)
void GPU_viewport_size_set(GPUViewport *viewport, const int size[2])
void GPU_viewport_tag_update(GPUViewport *viewport)
void GPU_viewport_unbind(GPUViewport *UNUSED(viewport))
void * GPU_viewport_framebuffer_list_get(GPUViewport *viewport)
void GPU_viewport_cache_release(GPUViewport *viewport)
static void gpu_viewport_draw_colormanaged(GPUViewport *viewport, const rctf *rect_pos, const rctf *rect_uv, bool display_colorspace, bool do_overlay_merge)
static GPUBatch * gpu_viewport_batch_get(GPUViewport *viewport, const rctf *rect_pos, const rctf *rect_uv)
#define MAX_ENGINE_BUFFER_SHARING
void * GPU_viewport_engine_data_create(GPUViewport *viewport, void *engine_type)
static GPUVertFormat * gpu_viewport_batch_format(void)
static struct @640 g_viewport
ViewportMemoryPool * GPU_viewport_mempool_get(GPUViewport *viewport)
static void gpu_viewport_engines_data_free(GPUViewport *viewport)
void GPU_viewport_size_get(const GPUViewport *viewport, int size[2])
BLI_INLINE float fb(float length, float L)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
struct CurveMapping * curve_mapping
struct GPUFrameBuffer * overlay_only_fb
struct GPUFrameBuffer * depth_only_fb
struct GPUFrameBuffer * overlay_fb
struct GPUFrameBuffer * stereo_comp_fb
struct GPUFrameBuffer * default_fb
struct GPUFrameBuffer * color_only_fb
struct GPUTexture * depth
struct GPUTexture * color_overlay_stereo
struct GPUTexture * color_overlay
struct GPUTexture * color
struct GPUTexture * color_stereo
struct GPUFrameBuffer * framebuffers[0]
struct GPUViewportBatch::@642 last_used_parameters
DefaultFramebufferList * fbl
ColorManagedViewSettings view_settings
struct GPUViewportBatch batch
ColorManagedDisplaySettings display_settings
struct GPUViewport::@644 engine_data[MAX_ENABLE_ENGINE]
ViewportMemoryPool vmempool
ViewportEngineData * data
struct DRWInstanceDataList * idatalist
CurveMapping * orig_curve_mapping
struct DRWPass * passes[0]
struct GPUTexture * textures[0]
struct BLI_memblock * commands_small
struct BLI_memblock * obmats
struct BLI_memblock * cullstates
struct BLI_memblock * views
struct GPUUniformBuf ** matrices_ubo
struct BLI_memblock * obinfos
struct BLI_memblock * passes
struct BLI_memblock * images
struct GHash * obattrs_ubo_pool
struct BLI_memblock * callbuffers
struct BLI_memblock * shgroups
struct BLI_memblock * commands
struct GPUUniformBuf ** obinfos_ubo
struct BLI_memblock * uniforms
struct ViewportTempTexture * next
struct ViewportTempTexture * prev
void * user[MAX_ENGINE_BUFFER_SHARING]
ccl_device_inline int rect_size(int4 rect)