[PR #14073] [MERGED] Added experimental.pixelShaderImagePath #29916

Open
opened 2026-01-31 09:37:36 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/14073
Author: @mrange
Created: 9/24/2022
Status: Merged
Merged: 3/8/2024
Merged by: @DHowett

Base: mainHead: mrange/shader_bitmap


📝 Commits (10+)

  • 5c831b4 Fixing spelling complaints
  • 052d112 Adding git submodule to DirectX ToolKit
  • ee9cc96 Added support for loading pixes shader texture to Atlas.
  • 44a8699 Squashed commit of the following:
  • a0df463 Mike forgot to update spelling
  • 007a71f Merge remote-tracking branch 'origin/main' into mrange/shader_bitmap
  • 60a7889 move to a cgimanifest instead of submodule
  • 47fa12f Rmoving submodules is hard?
  • 0217aba spel
  • de9bb21 Merge remote-tracking branch 'origin/main' into mrange/shader_bitmap

📊 Changes

21 files changed (+250 additions, -61 deletions)

View changed files

samples/PixelShaders/BackgroundImage.hlsl (+23 -0)
📝 src/cascadia/TerminalControl/ControlCore.cpp (+2 -0)
📝 src/cascadia/TerminalControl/IControlAppearance.idl (+1 -0)
📝 src/cascadia/TerminalCore/Terminal.cpp (+1 -1)
📝 src/cascadia/TerminalSettingsModel/IAppearanceConfig.idl (+1 -0)
📝 src/cascadia/TerminalSettingsModel/MTSMSettings.h (+1 -0)
📝 src/cascadia/TerminalSettingsModel/TerminalSettings.cpp (+1 -0)
📝 src/cascadia/TerminalSettingsModel/TerminalSettings.h (+1 -0)
📝 src/cascadia/inc/ControlProperties.h (+2 -1)
📝 src/renderer/atlas/AtlasEngine.api.cpp (+16 -0)
📝 src/renderer/atlas/AtlasEngine.cpp (+1 -1)
📝 src/renderer/atlas/AtlasEngine.h (+2 -0)
📝 src/renderer/atlas/Backend.h (+7 -0)
📝 src/renderer/atlas/BackendD3D.cpp (+26 -6)
📝 src/renderer/atlas/BackendD3D.h (+2 -0)
📝 src/renderer/atlas/atlas.vcxproj (+3 -2)
📝 src/renderer/atlas/common.h (+1 -0)
📝 src/renderer/atlas/pch.h (+1 -0)
src/renderer/atlas/wic.cpp (+153 -0)
📝 src/renderer/atlas/wic.h (+3 -50)

...and 1 more files

📄 Description

I realize I might be one of the few developers that care about custom
shader support in terminal but I thought it's worth proposing it and see
what you think.

This is to support custom shaders with custom textures.

I was thinking of exposing the background image to the shader but that
felt complicated after looking into it.

I have tested exploratively. I think the texture loader is possible to
unit test so that is a possible improvement.

The error reporting (as with other custom pixel shader code) is not very
good. That is also an area that I could improve upon.

I do think the risk of adding this is rather low as the new code is only
executed when experimental.pixelShaderImagePath is set.

Details

Only added to the Atlas engine. Unsure if needs adding in DXEngine?

Instead I load the texture using WIC into a shader resource view. When
binding shader resources I test for presence of custom texture and bind
it to register t1.

The image loading code was found in the D3D Texture documentation.
It's a mouthful but seems rather robust.

Tested setting: "experimental.pixelShaderImagePath"

  1. Tested not specifying it.
  2. Tested setting it.
  3. Tested changing it (the changes are picked up)
  4. Tested invalid path
  5. Tested a custom shader that made use of the custom texture.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/14073 **Author:** [@mrange](https://github.com/mrange) **Created:** 9/24/2022 **Status:** ✅ Merged **Merged:** 3/8/2024 **Merged by:** [@DHowett](https://github.com/DHowett) **Base:** `main` ← **Head:** `mrange/shader_bitmap` --- ### 📝 Commits (10+) - [`5c831b4`](https://github.com/microsoft/terminal/commit/5c831b4deb85c5a7523325bbf685ebf6a3f5df42) Fixing spelling complaints - [`052d112`](https://github.com/microsoft/terminal/commit/052d11242ec0dab3b0a51cff96e88b0266349eaf) Adding git submodule to DirectX ToolKit - [`ee9cc96`](https://github.com/microsoft/terminal/commit/ee9cc96c9e1778faaa633970723a071f2aaa07b7) Added support for loading pixes shader texture to Atlas. - [`44a8699`](https://github.com/microsoft/terminal/commit/44a86995e93196edfb5123a9aecb8aa46c785a84) Squashed commit of the following: - [`a0df463`](https://github.com/microsoft/terminal/commit/a0df4638098b131fc314e9ed46188d498fd45805) Mike forgot to update spelling - [`007a71f`](https://github.com/microsoft/terminal/commit/007a71f8a40a97f12e8baf930041312aab135d81) Merge remote-tracking branch 'origin/main' into mrange/shader_bitmap - [`60a7889`](https://github.com/microsoft/terminal/commit/60a7889f772b22b83790c7bb9784a4a8070561d9) move to a cgimanifest instead of submodule - [`47fa12f`](https://github.com/microsoft/terminal/commit/47fa12f5d350c68d4b6e0f38de6783c7170c4f83) Rmoving submodules is hard? - [`0217aba`](https://github.com/microsoft/terminal/commit/0217aba8ca625cc2961d58517fc002e2577af723) spel - [`de9bb21`](https://github.com/microsoft/terminal/commit/de9bb2170bcccc798fbefb73af99f85169ef80f3) Merge remote-tracking branch 'origin/main' into mrange/shader_bitmap ### 📊 Changes **21 files changed** (+250 additions, -61 deletions) <details> <summary>View changed files</summary> ➕ `samples/PixelShaders/BackgroundImage.hlsl` (+23 -0) 📝 `src/cascadia/TerminalControl/ControlCore.cpp` (+2 -0) 📝 `src/cascadia/TerminalControl/IControlAppearance.idl` (+1 -0) 📝 `src/cascadia/TerminalCore/Terminal.cpp` (+1 -1) 📝 `src/cascadia/TerminalSettingsModel/IAppearanceConfig.idl` (+1 -0) 📝 `src/cascadia/TerminalSettingsModel/MTSMSettings.h` (+1 -0) 📝 `src/cascadia/TerminalSettingsModel/TerminalSettings.cpp` (+1 -0) 📝 `src/cascadia/TerminalSettingsModel/TerminalSettings.h` (+1 -0) 📝 `src/cascadia/inc/ControlProperties.h` (+2 -1) 📝 `src/renderer/atlas/AtlasEngine.api.cpp` (+16 -0) 📝 `src/renderer/atlas/AtlasEngine.cpp` (+1 -1) 📝 `src/renderer/atlas/AtlasEngine.h` (+2 -0) 📝 `src/renderer/atlas/Backend.h` (+7 -0) 📝 `src/renderer/atlas/BackendD3D.cpp` (+26 -6) 📝 `src/renderer/atlas/BackendD3D.h` (+2 -0) 📝 `src/renderer/atlas/atlas.vcxproj` (+3 -2) 📝 `src/renderer/atlas/common.h` (+1 -0) 📝 `src/renderer/atlas/pch.h` (+1 -0) ➕ `src/renderer/atlas/wic.cpp` (+153 -0) 📝 `src/renderer/atlas/wic.h` (+3 -50) _...and 1 more files_ </details> ### 📄 Description I realize I might be one of the few developers that care about custom shader support in terminal but I thought it's worth proposing it and see what you think. This is to support custom shaders with custom textures. I was thinking of exposing the background image to the shader but that felt complicated after looking into it. I have tested exploratively. I think the texture loader is possible to unit test so that is a possible improvement. The error reporting (as with other custom pixel shader code) is not very good. That is also an area that I could improve upon. I do think the risk of adding this is rather low as the new code is only executed when experimental.pixelShaderImagePath is set. ### Details Only added to the Atlas engine. Unsure if needs adding in DXEngine? Instead I load the texture using WIC into a shader resource view. When binding shader resources I test for presence of custom texture and bind it to register t1. The image loading code was found in [the D3D Texture documentation]. It's a mouthful but seems rather robust. Tested setting: "experimental.pixelShaderImagePath" 1. Tested not specifying it. 2. Tested setting it. 3. Tested changing it (the changes are picked up) 4. Tested invalid path 5. Tested a custom shader that made use of the custom texture. 6. [the D3D Texture documentation]: https://learn.microsoft.com/en-us/windows/win32/direct3d11/overviews-direct3d-11-resources-textures-how-to --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:37:36 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#29916