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

Inspecting Immutable Textures #227

Closed
descryant opened this issue Feb 17, 2022 · 3 comments
Closed

Inspecting Immutable Textures #227

descryant opened this issue Feb 17, 2022 · 3 comments

Comments

@descryant
Copy link

descryant commented Feb 17, 2022

Hey! First of all, thanks for putting together this tool; it's been extremely helpful so far! However, it appears that immutable textures can't be viewed in the draw call inspector.

MWE: https://github.com/Descryant/immutable-texture-spector-mwe

The lines in question are part of main.js. When uploading the image data with texImage2D (mutable storage), everything works fine:

image

Now for the problem: If the texture storage is immutable (texStorage2D + texSubImage2D) with the exact same parameters, the render output remains the same but the properties textureType, format, internalformat, width and height are missing and no image shows up in the inspector:

image

To reproduce, comment out line 65 and uncomment lines 68 and 69.

Is this a usage error on my part or a bug / missing feature?

Cheers!

@ghost
Copy link

ghost commented Feb 18, 2022

I quickly skimmed over the related Spector.js code and this looks like your use-case should be supported:

private getTexStorage2DCustomData(functionInformation: IFunctionInformation, target: string, instance: WebGLTexture): ITextureRecorderData {

I assume that hook isn't called or it's called incorrectly / rejects your call.
I don't have time to debug this further though, but given your MWE, you can probably figure it out.

It looks like the texture is then being read here:

protected getTextureVisualState(target: WebGlConstant, storage: WebGLTexture, info: ITextureRecorderData, pixelated: boolean): any {

So it's probably not displayed due to missing information. However, there shouldn't be any need to have explicit support for the texSubImage2D call in Spector.js, due to fallbacks in isSupportedCombination and the data being retrieved from the texture (instead of capturing it from texture uploads).

@descryant
Copy link
Author

Thanks for the pointers. I'll update this thread when I get around to looking at the problem again. This wasn't a terribly high priority for me so it may be a little while. Cheers!

@sebavan
Copy link
Member

sebavan commented Feb 22, 2022

I ll try to check later tonight, thanks for the repro !!!

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

No branches or pull requests

2 participants