Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Texture creation from existing GPU texture#1257

Draft
Vipitis wants to merge 5 commits intopygfx:mainpygfx/pygfx:mainfrom
Vipitis:gpu-textureVipitis/pygfx:gpu-textureCopy head branch name to clipboard
Draft

Texture creation from existing GPU texture#1257
Vipitis wants to merge 5 commits intopygfx:mainpygfx/pygfx:mainfrom
Vipitis:gpu-textureVipitis/pygfx:gpu-textureCopy head branch name to clipboard

Conversation

@Vipitis
Copy link
Copy Markdown
Contributor

@Vipitis Vipitis commented Dec 31, 2025

hey, first PR here.

This mostly undoes the dependency inversion from pygfx/rendercanvas#153 by adding a classmethod that avoids the existing constructor and hopefully writes all required attributes.
Includes the same example but is much simpler as offscreen canvas context sorta works out of the box (I think it skips frames randomly as there is no managed swap chain).

I did a few tweaks to shadertoy to make it work, so this won't work with the main branch as is. Maybe it should just be the wgpu cube instead since this doesn't need the rendercanvas protocol and should just work with a manual render target. It also works if you create the texture from the .wgpu_object of a gfx.Texture but that is very constructed...
I am still new to this codebase so I just included everything that looked relevant. I didn't try any of the resource functionality.

Open for discussion and commits into this branch (always), don't indent to make decisions as I am only tangentially using pygfx via fpl and real users might need different functionality. I also want to bring this sorta functionality to the shadertoy project, but it would be great to decide on a common interface.

connections:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.