Skip to content
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

Shader Extension Proposal #202

Draft
wants to merge 9 commits into
base: sdl_gpu
Choose a base branch
from
Draft

Shader Extension Proposal #202

wants to merge 9 commits into from

Conversation

thatcosmonaut
Copy link
Member

Tried to create something that would be as minimally invasive to the rest of the API as possible. When using the graphics shader extension, the rest of the API is still used normally, only the Effect calls are omitted.

Technically this doesn't break ABI because isRenderTarget on CreateTexture_ is now interpreted as a bitflag, but the value was always 1 or 0 before.

@@ -166,7 +166,8 @@ typedef enum FNA3D_CubeMapFace
typedef enum FNA3D_BufferUsage
{
FNA3D_BUFFERUSAGE_NONE,
FNA3D_BUFFERUSAGE_WRITEONLY
FNA3D_BUFFERUSAGE_WRITEONLY,
FNA3D_BUFFERUSAGE_COMPUTE_EXT /* SDL shader extension only */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean 'usable by compute AND write only'? Or is it a bit

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value is actually completely ignored on every backend, so setting COMPUTE_EXT on the SDL backend is the only place this would actually matter.

include/FNA3D.h Outdated
*/
FNA3DAPI void FNA3D_BindComputeTexturesEXT(
FNA3D_Device *device,
SDL_GpuComputeTextureBinding *pBindings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a blessed way to feed FNA3D textures in to this? Or would you use a SysTexture?
From looking at this it seems like in this proposal, fragment/vertex shaders ('graphics' shaders) can only consume FNA3D textures, and compute shaders can only consume raw SDL_Gpu textures.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FNA3D texture handles are just sdl_gpu texture handles, but I agree that this is awkward... I'll just wrap the SDL struct and handle it in the implementation

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I was wrong and FNA3D_Driver_SDL was wrapping the texture handles. So nice catch!

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

Successfully merging this pull request may close these issues.

None yet

3 participants