diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-04 00:29:24 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-04 00:29:24 +0100 |
| commit | 4632788c4bef265e58630473eed5559bf125a726 (patch) | |
| tree | 9264d8f59c8914e118adfafc4592ee77377eaf9e /src/hl2h.cpp | |
| parent | Skybox image: fix HDR sky binding; clip checkbox/arrow drawing (diff) | |
| download | hl2h-4632788c4bef265e58630473eed5559bf125a726.tar.gz hl2h-4632788c4bef265e58630473eed5559bf125a726.zip | |
Skybox image: power-of-two resize; upload at FRAME_RENDER_START
- The material system rejects textures whose dimensions are not multiples of 4
("Image dimensions must be multiple of 4!"), so scale the decoded image to
the next power of two (bilinear). 798x798 -> 1024x1024. The invalid VTF also
crashed the renderer after the apply.
- Move skybox_update() out of the VGUI paint hook into the FRAME_RENDER_START
FrameStageNotify stage. ITexture::Download only regenerates bits when the
material system considers the frame render-safe; during paint it returned
early, the regenerator never ran (no pixels), and a later upload of the
empty VTF crashed.
- Log the regenerator entry so the log shows whether the upload path ran.
Diffstat (limited to 'src/hl2h.cpp')
| -rw-r--r-- | src/hl2h.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/hl2h.cpp b/src/hl2h.cpp index 4ba1af3..28b2995 100644 --- a/src/hl2h.cpp +++ b/src/hl2h.cpp | |||
| @@ -770,6 +770,10 @@ static void hkdFrameStageNotify(void *self, int stage) { | |||
| 770 | if (oFrameStageNotify) | 770 | if (oFrameStageNotify) |
| 771 | oFrameStageNotify(self, stage); | 771 | oFrameStageNotify(self, stage); |
| 772 | if (stage == 5) { | 772 | if (stage == 5) { |
| 773 | // Skybox texture uploads happen here, not in the VGUI paint hook: the | ||
| 774 | // material system only downloads procedural textures on a render-safe | ||
| 775 | // frame stage. | ||
| 776 | skybox_update(); | ||
| 773 | if (g_silent_restore_pending) { | 777 | if (g_silent_restore_pending) { |
| 774 | g_silent_restore_pending = false; | 778 | g_silent_restore_pending = false; |
| 775 | if (g_iface.engine) { | 779 | if (g_iface.engine) { |
