Skip to content

Replace ifstream/ofstream with istream/ostream in ShaderCache - #1606

Merged
bghgary merged 1 commit into
BabylonJS:masterfrom
bghgary:shadercache-istream
Feb 18, 2026
Merged

bghgary merged 1 commit into
BabylonJS:masterfrom
bghgary:shadercache-istream

Conversation

@bghgary

@bghgary bghgary commented Feb 18, 2026 •

Copy link
Copy Markdown
Contributor

This pull request updates the shader cache serialization and deserialization logic to use more generic stream types, improving flexibility and code reuse. The main change is replacing the use of file stream types (std::ifstream, std::ofstream) with their base stream types (std::istream, std::ostream) throughout the shader cache API and implementation.

API and Implementation Stream Type Generalization

  • Changed the signatures of Save and Load functions in the Babylon::Plugins::ShaderCache namespace and ShaderCacheImpl class to use std::ostream and std::istream instead of std::ofstream and std::ifstream, allowing for more flexible stream handling. [1] [2] [3] [4] [5] [6]
  • Updated helper functions SaveString and LoadString to accept std::ostream and std::istream parameters instead of file streams, supporting the generalized stream usage.

Copilot AI review requested due to automatic review settings February 18, 2026 16:39
@bghgary
bghgary enabled auto-merge (squash) February 18, 2026 16:40
@bghgary
bghgary requested review from CedricGuillemet and removed request for Copilot February 18, 2026 16:40

@SergioRZMasson SergioRZMasson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@bghgary
bghgary merged commit 24c2d42 into BabylonJS:master Feb 18, 2026
31 checks passed
@bghgary
bghgary deleted the shadercache-istream branch February 18, 2026 17:30
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.

3 participants