-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make depth_stencil_attachment follow the spec #611
base: main
Are you sure you want to change the base?
Conversation
depth_keys_okay = True | ||
depth_load_op = ds_attachment["depth_load_op"] | ||
depth_store_op = ds_attachment["depth_store_op"] | ||
if depth_load_op == "clear": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a better way of doing this? Will anyone specify "clear" by its integer value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine, the integer values of enums from wgpu-native are an implementation detail and should not be usable by the caller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!
depth_keys_okay = True | ||
depth_load_op = ds_attachment["depth_load_op"] | ||
depth_store_op = ds_attachment["depth_store_op"] | ||
if depth_load_op == "clear": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine, the integer values of enums from wgpu-native are an implementation detail and should not be usable by the caller.
wgpu/backends/wgpu_native/_api.py
Outdated
warnings.warn( | ||
f"Unexpected key {key} in depth_stencil_attachment", | ||
DeprecationWarning, | ||
stacklevel=2, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use logger.warning()
instead of the warnings module.
Another thing is that (I think) this warning would be shown on each draw, which may be a bit much. Perhaps we can do something like:
if not getattr(self._device, "_showed_depth_stencilwarning", False):
self._device._showed_depth_stencilwarning = True
logger.warning(....)
Simplify test_wgpu_native_render.py Add test that warnings occur, but only once.
https://www.w3.org/TR/webgpu/#depth-stencil-attachments
Make depth_stencil_attachment more closely follow the specification. No longer do we need to specify stencil_xxx if it's a depth, and no need to specify depth_xxx if it's a stencil. We only need to specify "color" if it's a "clear".