BGL deprecation #80730
Open
opened 2020-09-12 18:08:00 +02:00 by Clément Foucault
·
36 comments
No Branch/Tag Specified
main
blender-v4.0-release
new-color-presets-addons
blender-v3.3-release
blender-v3.6-release
blender-v3.5-release
brush-assets-project
blender-v2.93-release
blender-v3.4-release
xr-dev
blender-v3.2-release
blender-v3.1-release
screenshots-manual
gltf_vtree
blender-v2.83-release
blender-v3.0-release
xr-controller-support
studio-sprite-fright
asset-browser-poselib
blender-v2.92-release
blender-v2.91-release
blender-v2.90-release
greasepencil-addon
xr-world-navigation
soc-2019-openxr
blender-v2.82-release
blender-v2.81-release
filebrowser_redesign
blender-v2.80-release
blender2.7
blender-v2.79b-release
blender-v2.79a-release
blender-v2.79-release
fbx_experiments
blender-v2.78b-release
collada-2
blender-v2.78-release
rigify_fixes
fbx_io_export_ignore_parents
v3.6.4
v3.6.3
v3.3.11
v3.6.2
v3.3.10
v3.6.1
v3.3.9
v3.6.0
v3.3.8
v3.3.7
v2.93.18
v3.5.1
v3.3.6
v2.93.17
v3.5.0
v2.93.16
v3.3.5
v3.3.4
v2.93.15
v2.93.14
v3.3.3
v2.93.13
v2.93.12
v3.4.1
v3.3.2
v3.4.0
v3.3.1
v2.93.11
v3.3.0
v3.2.2
v2.93.10
v3.2.1
v3.2.0
v2.83.20
v2.93.9
v3.1.2
v3.1.1
v3.1.0
v2.83.19
v2.93.8
v3.0.1
v2.93.7
v3.0.0
v2.93.6
v2.93.5
v2.83.18
v2.93.4
v2.93.3
v2.83.17
v2.93.2
v2.93.1
v2.83.16
v2.93.0
v2.83.15
v2.83.14
v2.83.13
v2.92.0
v2.83.12
v2.91.2
v2.83.10
v2.91.0
v2.83.9
v2.83.8
v2.83.7
v2.90.1
v2.83.6
v2.90.0
v2.83.5
v2.83.4
v2.83.3
v2.83.2
v2.83.1
v2.83
v2.82a
v2.82
v2.81a
v2.81
v2.80
v2.80-rc3
v2.80-rc2
v2.80-rc1
v2.79b
v2.79a
v2.79
v2.79-rc2
v2.79-rc1
v2.78b
v2.78a
v2.78
v2.78-rc2
v2.78-rc1
v2.77a
v2.77
v2.77-rc2
v2.77-rc1
v2.76a
v2.76
v2.76-rc3
v2.76-rc1
v2.75
v2.75-rc2
v2.75-rc1
v2.74
v2.74-rc4
v2.74-rc3
v2.74-rc2
v2.74-rc1
v2.73a
v2.73
v2.73-rc1
v2.72
v2.72-rc1
v2.71
v2.71-rc1
v2.70a
v2.70
v2.70-rc
v2.69
v2.68
v2.67b
v2.67a
v2.67
v2.66a
v2.66
v2.65a
v2.65
v2.64a
v2.64
v2.63a
v2.63
v2.62
v2.61
v2.60a
v2.60
v2.59
v2.58a
v2.58
v2.57b
v2.57a
v2.57
v2.56a
v2.56
v2.55
v2.54
v2.53
Labels
Clear labels
Apply labels
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
Milestone
Set milestone
Clear milestone
No items
No Milestone
Projects
Set Project
Clear projects
No project
Assignees
Assign users
Clear assignees
No Assignees
30 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#80730
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Situation:
For 2.91 we refactored the whole GPU module to be ready for vulkan. In this process we added a state tracking mechanism which removes unneeded state changes by only pushing the state before drawing commands.
The issue is that BGL does not make use of this and directly use the GL API which can lead to unsafe states.
The current workaround is to push the state to the GL before the callbacks loop starts and just force reset all states after the loop (see blender/blender@fe5efccd8f).
This is quite ugly since it does not prevent misusage of the BGL API with the pyGPU API (which is using our GPU module states).
So we have things to do here:
Polish the pyGPU API and force its usage everywhere: Impractical for 2.91 because there would be no transition period. But we do need to get started already since the API did change a little (see GPUOffscreen). A refactor is in the process here D8826. This is the long term plan.blender/blender@4430e8a008Make wrappers inside the BGL module to make theblender/blender@f12b0373f3GPUState
undefined if calling a function that modifies it: This would trigger a special path insidegl_state.cc
where the state would be ignored. This should fix some of the API mixing issues.glClear
,glDrawArray
,glReadPixels
, ...). ~~ blender/blender@f12b0373f3The last remaining issue is our resource binding check that needs to be disable because incompatible with theblender/blender@f12b0373f3glUniform + glBindTexture
idiom (we now use internal fixed binding points).We still have to figure how to mitigate:
Current framebuffer state: calling(Resolved with python'sglBindFramebuffer(GL_FRAMEBUFFER, id)
will break the state tracking.with
statement forcing a context specific block. See blender/blender@4430e8a008)glUseProgam(program)
will break the state tracking.Other issues with pyGPU:
Addons and scripts using the bgl module:
547adaa4ed
)f7c2fc6395
)c383b02744
)294e899bf7
)5578ae83b3
)6feb9c532d
)a1424dc87f
)d37c2abc6f
)708255a88f
)be6cbe0222
)c8109966ce
)ce8c5f8d1b
)c1cdc33579
)f3e1e980b6
)af94627460
)ec558f2a91
)Related links:
https://devtalk.blender.org/t/suggestions-feedback-on-the-extensions-for-the-gpu-module/17706/38
Changed status from 'Needs Triage' to: 'Confirmed'
Added subscribers: @fclem, @ideasman42, @brecht, @mano-wii
Added subscriber: @rjg
Added subscriber: @EAW
Added subscriber: @lichtwerk
Added subscriber: @slumber
Added subscriber: @Jeroen-Bakker
Added subscriber: @JacobMerrill-1
So all the same abilities - (grab texture ID - replace with new Texture using py - will be abstracted now like the draw calls in order to be restored?)
Added subscriber: @KenzieMac130
Added subscriber: @MACHIN3
Added subscriber: @erik85
Added subscriber: @2046411367
Added subscriber: @ckohl_art
Added subscriber: @PhilippeCrassous
Once D8826: Python: gpu module: add new submodules and types is committed, this task should be updated to reflect the current status.
Besides taking care of any remaining known API issues and documenting the new APIs, I think we should also involve the community. Once we are ready for it, I suggest to:
This issue was referenced by blender/blender@4430e8a008
This issue was referenced by
f01d08b7c5
Added subscriber: @jta
Added subscriber: @lvxejay
Added subscriber: @JasonvanGumster
Added subscriber: @cwolf3d
Added subscriber: @warcanin
Added subscriber: @alisealy
Added subscriber: @blendersamsonov
Added subscriber: @regcs
Added subscriber: @Raimund58
Added subscriber: @Imaginer
Added subscriber: @timodriaan
Added subscriber: @hlorus
Added subscriber: @gfxcoder
Added subscriber: @JakubUhlik
This issue was referenced by blender/blender@1a627d528c
So, which release is BGL actually going to be removed for? And why was object_collection_manager removed from the list?
Probably in 3.4 (along with the Metal stand support)
It doesn't look like this addon has ever used
bgl
, it seems like it was a mistake to add it to the list.No, it uses
bgl
fairly extensively inqcd_move_widget.py
(I should know, I'm the author 😛 )I've been waiting to update it to use the pyGPU API for a number of reasons, but if it's official that
bgl
is being removed for 3.4 then I'll update it.