BGL deprecation #80730
Labels
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
No Milestone
No project
No Assignees
30 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#80730
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. 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.