BabylonJS / Spector.js

Explore and Troubleshoot your WebGL scenes with ease.

Home Page:http://spector.babylonjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inspecting Immutable Textures

descryant opened this issue · comments

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!

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).

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!

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