Skip to content

Adds ConcreteTexture.ValidateGetDataSurfaceFormat methods#2636

Open
squarebananas wants to merge 2 commits into
kniEngine:mainfrom
squarebananas:TextureGetDataFormat
Open

Adds ConcreteTexture.ValidateGetDataSurfaceFormat methods#2636
squarebananas wants to merge 2 commits into
kniEngine:mainfrom
squarebananas:TextureGetDataFormat

Conversation

@squarebananas

Copy link
Copy Markdown
Contributor

Adds ConcreteTexture.ValidateGetDataSurfaceFormat methods for GLES & BlazorGL.

As GetTexImage and GetCompressedTexImage are unavailable on GLES and WebGL, for these platforms it is necessary to use FramebufferTexture along with ReadPixels for the Texture.GetData implementations. However this approach cannot be used with all SurfaceFormat types.

Currently there is a comment related to this as follows:
// TODO: check for non renderable formats (formats that can't be attached to FBO)

By adding these methods, this will allow subsequent PRs to implement throwing an exception if an unsupported SurfaceFormat is used with Texture.GetData.

This PR follows on from the #2635 PR. Although not directly dependent itself, some of the subsequent PRs will need both these PRs for their implementations.

@nkast

nkast commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

@squarebananas , would you please rebase this, to see if it builds?

@squarebananas
squarebananas force-pushed the TextureGetDataFormat branch from cd6eae3 to 5f55bb2 Compare July 24, 2026 14:46
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.

2 participants