-
Notifications
You must be signed in to change notification settings - Fork 158
NativeEngine: texture upload, cubemap loading, and readback improvements #1808
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
Open
bkaradzic-microsoft
wants to merge
9
commits into
BabylonJS:master
Choose a base branch
from
bkaradzic-microsoft:pr/texture-upload-formats
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
49f6357
NativeEngine: load single-file .dds/.ktx/.ktx2 cubemaps + spherical h…
bkaradzic efc4252
NativeEngine: implement updateTextureData (re-enables Test updateText…
bkaradzic 92aabb2
NativeEngine: add updateTextureDirectly texture-loader sink
bkaradzic 865ce4a
NativeEngine: route cube-texture UpdateTextureData to bgfx::updateTex…
bkaradzic 6c93259
Fix BC1/DXT1 texture-load crash in NativeEngine
bkaradzic 4c4abb3
Support cube-map face readback in NativeEngine.readTexture
bkaradzic a17b21b
Native raw 3D textures + sampler3D texelFetch fix
bkaradzic 5d8c2e1
Address Copilot review feedback
bkaradzic a3241c1
Address review feedback on texel flip, texture metadata and updateTex…
bkaradzic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 20 additions & 1 deletion
21
Apps/UnitTests/JavaScript/dist/tests.shaderCompilation.comprehensiveGLSL.js
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Reviewed by Copilot on behalf of @bghgary]
m_depthis only ever assigned here, andDispose()clears just the handle — so aTexturere-created as 2D or cube after having been 3D keeps the old depth andDepth()returns a stale value. The siblingCreate*methods each resetm_is3Dbut none of them resetm_depth.Each
Create*hand-assigning its own subset of the metadata is what made the deadm_is3Dstore possible too; a shared reset would close both.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed and fixed in a3241c1.
m_depthwas assigned only byCreate3D, andDispose()clears just the handle, so aTexturere-created as 2D or cube after having been 3D kept reporting the old depth.I took the shared-reset route you suggested rather than adding one more hand-written assignment. There is now a private
ResetMetadata()that returns every shape field to its default, andCreate2D,Create3D,CreateCubeandAttachall call it immediately afterDispose()before assigning the subset that applies to them. That also let me delete the scatteredm_isCube = false; m_is3D = false;lines, which is what made the class of bug possible in the first place: any field a given path forgets is now defaulted rather than inherited from the previous, differently shaped texture.