Skip to content

Overlay for running GPU shaders on top of Windows desktop

License

Notifications You must be signed in to change notification settings

blakebratcher/ShaderGlass

 
 

Repository files navigation

ShaderGlass

ShaderGlass

Optimized Fork

GPU shader overlay for Windows desktop | 1200+ RetroArch shaders | DirectX 11

License: GPL v3 C++20 DirectX 11 VS 2026 Windows 10/11

Forked from mausimus/ShaderGlass with performance optimizations, critical bug fixes, and modernized build tooling.



ShaderGlass running on Windows 11 desktop


What's Changed

Performance

  • Ping-pong feedback buffers -- Eliminates CopyResource per frame by alternating texture read/write roles between passes
  • Batched GPU bindings -- Single PSSetSamplers / PSSetShaderResources call per pass instead of per-texture
  • Direct texture pointers -- Cached raw ID3D11Texture2D* alongside owning com_ptrs for zero-overhead access in the render loop
  • O(1) parameter lookup -- unordered_map replaces linear search in SetParam
  • Unconditional CB uploads -- Removed broken dirty tracking that never saved work

Bug Fixes

  • CopyAttribute stale-HRESULT -- Was checking a global static from a previous call instead of the actual return value
  • Release build crash -- assert(false) compiled out, causing null deref on shader compile failure
  • GrabOutput crash -- Missing null check on captured frame
  • Resource leaks -- COM pointers not released in cleanup paths
  • NULL deref in catch -- Dead catch block iterated a NULL array
  • Save dialog -- Wrong flag (OFN_FILEMUSTEXIST on a save dialog)
  • Uninitialized members -- Garbage preset index on first hotkey use

Code Quality

Area Improvement
Error handling THROW_IF_FAILED(hr) macro with file, line, and expression context -- added across the entire codebase
Thread safety RAII ThreadHandle wrapper replaces raw CreateThread / CloseHandle
Input validation Bounds-checked parsing for all shader config values with overflow protection
Build warnings Fixed wchar_t narrowing conversion (5x per build); total warnings reduced from 7 to 2
Repo size Removed ~186 MB of pre-built binaries from version control

Building

Visual Studio 2026  |  C++20  |  Windows SDK 10.0.26100  |  Release | x64
# Open and build
ShaderGlass.sln  -->  Release | x64

See CLAUDE.md for full architecture docs, threading model, shader pipeline details, and development notes.


Screenshots

Desktop Glass Mode -- transparent overlay applies shaders to anything behind it
Desktop Glass mode - CRT shader on Chrome
Window Clone Mode -- capture a specific window with pixel-perfect scaling
FS-UAE with CRT shader

Altirra with TV-OUT shader

Adventure Game Studio with MegaBezel shader

DOSBox with newpixie-crt shader

Original project by mausimus | Upstream Repo | GPLv3 | Shaders from libretro/slang-shaders

About

Overlay for running GPU shaders on top of Windows desktop

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 99.8%
  • Yacc 0.2%
  • HTML 0.0%
  • CMake 0.0%
  • JavaScript 0.0%
  • GLSL 0.0%