#103978 Add deprecation warnings to GPUBatch program usage. #117299

Closed
Prakhar-Singh-Chouhan wants to merge 15 commits from Prakhar-Singh-Chouhan/blender:#103978 into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Contributor

Continuing my previous #105295. This pull request adds the reviews mentioned.

Continuing my previous https://projects.blender.org/blender/blender/pulls/105295. This pull request adds the reviews mentioned.
Prakhar-Singh-Chouhan requested review from Jeroen Bakker 2024-01-18 18:41:18 +01:00
Jeroen Bakker requested changes 2024-01-19 08:56:44 +01:00
@ -178,6 +178,11 @@ PyDoc_STRVAR(
" :type program: :class:`gpu.types.GPUShader`\n");
static PyObject *pygpu_batch_program_set(BPyGPUBatch *self, BPyGPUShader *py_shader)
{
/*raising Deprecation Warning when calling `gpu.types.GPUBatch.program_set` */
Member

Make sure you run make format in your source folder to ensure the formatting rules have been applied

Make sure you run `make format` in your source folder to ensure the formatting rules have been applied
@ -179,2 +179,4 @@
static PyObject *pygpu_batch_program_set(BPyGPUBatch *self, BPyGPUShader *py_shader)
{
/*raising Deprecation Warning when calling `gpu.types.GPUBatch.program_set` */
PyErr_WarnEx(PyExc_DeprecationWarning,
Member

Perhaps also guard this with a static bool deprecation_warning_issued other wise the console will be flooded with messages and it influence performance.

Perhaps also guard this with a `static bool deprecation_warning_issued` other wise the console will be flooded with messages and it influence performance.
@ -180,1 +180,4 @@
{
/*raising Deprecation Warning when calling `gpu.types.GPUBatch.program_set` */
PyErr_WarnEx(PyExc_DeprecationWarning,
"'program_Set' is deprecated."
Member

Typo it is program_set

Typo it is `program_set`
@ -181,0 +181,4 @@
/*raising Deprecation Warning when calling `gpu.types.GPUBatch.program_set` */
PyErr_WarnEx(PyExc_DeprecationWarning,
"'program_Set' is deprecated."
"Please set the shader directly when calling GPUBatch.draw", 1);
Member

Mention the program parameter, so developers don't need to lookup the parameter when this message is shown

Mention the program parameter, so developers don't need to lookup the parameter when this message is shown
Author
Contributor

@Jeroen-Bakker What should the program parameter be ???

@Jeroen-Bakker What should the program parameter be ???
Member
Calls to GPUBatch.program_set are deprecated. Please set the shader via the 'program' parameter when calling GPUBatch.draw/draw_instanced/draw_range.
``` Calls to GPUBatch.program_set are deprecated. Please set the shader via the 'program' parameter when calling GPUBatch.draw/draw_instanced/draw_range. ```
@ -226,0 +237,4 @@
"Calling GPUBatch.draw without specifying a program is deprecated. "
"Please provide a valid GPUShader as the 'program' parameter.",
1);
}
Member

I expected deprecation_warning_issued = true; statement here

I expected `deprecation_warning_issued = true;` statement here
Jeroen Bakker added the
Module
Python API
label 2024-01-19 08:57:53 +01:00
Jeroen Bakker added this to the EEVEE & Viewport project 2024-01-19 08:57:59 +01:00
Jeroen Bakker added
Module
EEVEE & Viewport
Interest
Python API
and removed
Module
Python API
labels 2024-01-19 08:58:17 +01:00
Jeroen Bakker reopened this pull request 2024-01-19 11:44:42 +01:00
Member

Please don't close pull request, just update them, otherwise the code review will get really complicated and doesn't leave a trail of evidence. You can just push to your branch and the pull request will automatically update.

Please don't close pull request, just update them, otherwise the code review will get really complicated and doesn't leave a trail of evidence. You can just push to your branch and the pull request will automatically update.
Author
Contributor

i had some problems with keeping my branch upto date so I closed this and made a new pull request with the changes #117324

i had some problems with keeping my branch upto date so I closed this and made a new pull request with the changes https://projects.blender.org/blender/blender/pulls/117324
Member

Sorry, but it is best to update this branch. You can do a force push to this branch if you had problems updating your branch

Sorry, but it is best to update this branch. You can do a force push to this branch if you had problems updating your branch
Author
Contributor

@Jeroen-Bakker did the changes in this PR itself. Can you have a look at it ? Should I close this one#117324 ?

@Jeroen-Bakker did the changes in this PR itself. Can you have a look at it ? Should I close this onehttps://projects.blender.org/blender/blender/pulls/117324 ?
Member

Still one comment has not been solved. If you have questions about it, you can reply on the comment

Still one comment has not been solved. If you have questions about it, you can reply on the comment
Member

@blender-bot build

@blender-bot build
Author
Contributor

Still one comment has not been solved. If you have questions about it, you can reply on the comment

@Jeroen-Bakker what should the program parameter be that I should display??

> Still one comment has not been solved. If you have questions about it, you can reply on the comment @Jeroen-Bakker what should the program parameter be that I should display??
Prakhar-Singh-Chouhan force-pushed #103978 from 9c5e86ef84 to 15a14661a8 2024-01-22 13:48:40 +01:00 Compare
Prakhar-Singh-Chouhan force-pushed #103978 from 15a14661a8 to 008cea20f0 2024-01-23 09:49:50 +01:00 Compare
Author
Contributor

@Jeroen-Bakker I forced pushed the changes from my branch, but other changes have also been added in it which I don't understand. Can you have a look at those ?

@Jeroen-Bakker I forced pushed the changes from my branch, but other changes have also been added in it which I don't understand. Can you have a look at those ?
Member

Only blender organization members with write access can start builds. See documentation for details.

Only blender organization members with write access can start builds. See [documentation](https://projects.blender.org/infrastructure/blender-bot/src/branch/main/README.md) for details.
Member

You did a merge, but didn't resolve the merge issues. You have to resolve them. Currently your branch doesn't compile
as they conflicts have not been resolved..

You did a merge, but didn't resolve the merge issues. You have to resolve them. Currently your branch doesn't compile as they conflicts have not been resolved..
Prakhar-Singh-Chouhan added 2 commits 2024-01-27 11:24:29 +01:00
Prakhar-Singh-Chouhan force-pushed #103978 from 4cda8c8410 to 52fa197a73 2024-01-27 14:17:50 +01:00 Compare
Prakhar-Singh-Chouhan added 1 commit 2024-01-27 14:33:36 +01:00
Prakhar-Singh-Chouhan added 1 commit 2024-01-27 14:34:52 +01:00
Author
Contributor

@Jeroen-Bakker I have merged the changes, can you have a look at them.

@Jeroen-Bakker I have merged the changes, can you have a look at them.
Jeroen Bakker requested changes 2024-01-29 08:38:13 +01:00
Jeroen Bakker left a comment
Member

This patch still has some merge conflicts markings and therefore doesn't compile.

This patch still has some merge conflicts markings and therefore doesn't compile.
Prakhar-Singh-Chouhan added 1 commit 2024-01-29 10:47:42 +01:00
Author
Contributor

@Jeroen-Bakker removed the merge conflict markings.

@Jeroen-Bakker removed the merge conflict markings.
Member

Please make sure you run make format before committing. There are some parts of the code that doesn't follow our code style conventions.

See https://developer.blender.org/docs/handbook/guidelines/c_cpp/ and specifically the section about comments.

Please make sure you run `make format` before committing. There are some parts of the code that doesn't follow our code style conventions. See https://developer.blender.org/docs/handbook/guidelines/c_cpp/ and specifically the section about comments.
Prakhar-Singh-Chouhan added 1 commit 2024-01-29 16:48:07 +01:00
Author
Contributor
@Jeroen-Bakker done.
Author
Contributor

@Jeroen-Bakker is the issue resolved or do I have to make any changes to the PR ?

@Jeroen-Bakker is the issue resolved or do I have to make any changes to the PR ?
Jeroen Bakker reviewed 2024-02-12 09:32:23 +01:00
@ -184,0 +184,4 @@
static bool deprecation_warning_issued = false;
/* deprecation warning raised when calling `gpu.types.GPUBatch.program_set`. */
Member

Sentences should start with a capital. Also check the comment you wrote later in the PR.

Sentences should start with a capital. Also check the comment you wrote later in the PR.
Jeroen Bakker requested changes 2024-02-12 09:33:38 +01:00
Jeroen Bakker left a comment
Member

If you want to place the PR in my inbox again, there is a button you can press next to my name. I had to spent more time looking for the PR, than actually reviewing :-)

If you want to place the PR in my inbox again, there is a button you can press next to my name. I had to spent more time looking for the PR, than actually reviewing :-)
Prakhar-Singh-Chouhan added 1 commit 2024-02-14 20:50:27 +01:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
a27d08ba67
final changes
Author
Contributor
@Jeroen-Bakker Done
Jeroen Bakker approved these changes 2024-02-19 16:09:53 +01:00
Member

@blender-bot build

@blender-bot build
Raul Fernandez Hernandez approved these changes 2024-02-19 16:17:16 +01:00
Author
Contributor

@Jeroen-Bakker should i do some changes to this ?

@Jeroen-Bakker should i do some changes to this ?
Member

Thanks for the heads up. The build failed due to other out of date head. Committed to main via 4ce13fe198

Thanks for your work on this task!

Thanks for the heads up. The build failed due to other out of date head. Committed to main via 4ce13fe1986cc9f262b9711e36f18dcc9db68154 Thanks for your work on this task!
Jeroen Bakker closed this pull request 2024-03-04 08:33:59 +01:00
Prakhar-Singh-Chouhan changed title from WIP #103978 Add deprecation warnings to GPUBatch program usage. to #103978 Add deprecation warnings to GPUBatch program usage. 2024-03-04 16:29:21 +01:00
Some checks failed
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.

Pull request closed

Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
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 Assignees
4 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#117299
No description provided.