Skip to content

gl_shader: fix shader dump line numbering#1922

Open
illwieckz wants to merge 19 commits intofor-0.56.0/syncfrom
illwieckz/shader-dump-line-numbering
Open

gl_shader: fix shader dump line numbering#1922
illwieckz wants to merge 19 commits intofor-0.56.0/syncfrom
illwieckz/shader-dump-line-numbering

Conversation

@illwieckz
Copy link
Copy Markdown
Member

  • reset line number at GLSL shader start
  • use custom line number for the GLSL header to avoid line number duplicates
  • use custom line number for the deform vertex header
  • reset line count on #line 0

Written to debug:

@illwieckz illwieckz force-pushed the illwieckz/shader-dump-line-numbering branch 2 times, most recently from 41ab201 to 983d178 Compare March 4, 2026 10:57
@illwieckz illwieckz changed the title renderer: fix shader dump line numbering gl_shader: fix shader dump line numbering Mar 9, 2026
@slipher
Copy link
Copy Markdown
Member

slipher commented Mar 19, 2026

We should be able to avoid inserting #line 0 and then doing string replacements later. I think the key issue here is that ProcessInserts is called on text that already has hard-coded stuff prepended. But that hard-coded stuff shouldn't contain inserts, so it would make more sense to call ProcessInserts with only the actual file contents. Then you wouldn't have the problem of not knowing where the first line is.

runlevel5 and others added 6 commits March 27, 2026 23:32
Add build support for ppc64le (little-endian, POWER8+) and ppc64
(big-endian, POWER5+) architectures:

- CMake architecture detection, compiler flags (-mcpu), and NaCl build
  defines for ppc64el/ppc64
- NACL_RUNTIME_ARCH allowlist and DAEMON_NACL_RUNTIME_ENABLED define to
  track whether a NaCl loader exists for the target architecture
- vm.nacl.available ROM cvar so the UI can detect NaCl availability
- Sys::Error when attempting to launch a NaCl VM on a platform without
  a NaCl loader, advising to use native DLL mode with devmap
Run x86_64 NaCl loader and amd64 .nexe game modules under Box64
emulation on platforms without native NaCl support. The native engine
communicates with the emulated NaCl sandbox processes via
architecture-independent Unix domain socket IPC, requiring no changes
to game modules.

- Add opt-in DAEMON_NACL_BOX64_EMULATION CMake option (OFF by default,
  Linux only) that remaps NACL_ARCH to amd64
- Replace architecture-specific NaCl dummy defines with a generic
  fallback for any unsupported architecture
- Prepend box64 to NaCl loader args with PATH resolution
- Skip bootstrap helper (incompatible with Box64 double-exec)
- Disable platform qualification for emulated loader
- Add cvars: vm.box64.path, workaround.box64.disableBootstrap,
  workaround.box64.disableQualification
If for any reason, we fail to find a tag for iqm/md5 code, if the
attachment is uninitialized like in the entity cache code, we will
return NaNs. Fixes this crash for me:

```
    tuple=...) at /mnt/media/code/unv-master/daemon/src/common/Util.h:136
    at /mnt/media/code/unv-master/daemon/src/common/Util.h:141
```
This is truly unnecessary now that we have versions in the server list.

Fixes Unvanquished/Unvanquished#1540
@illwieckz
Copy link
Copy Markdown
Member Author

We should be able to avoid inserting #line 0 and then doing string replacements later. I think the key issue here is that ProcessInserts is called on text that already has hard-coded stuff prepended. But that hard-coded stuff shouldn't contain inserts, so it would make more sense to call ProcessInserts with only the actual file contents. Then you wouldn't have the problem of not knowing where the first line is.

I agree but I don't know how to do otherwise.

slipher added 12 commits April 20, 2026 15:15
Fixes Unvanquished/Unvanquished#1102.

This fixes a bug where the configstring state could be wrong due to `cs`
server commands being executed out of order with respect to game state
processing. Server commands are only processed when the cgame requests a
snapshot, so commands received before the client loads the current map
which were sent before the gamestate could be processed after the
gamestate.

Of course there are other commands besides setting configstrings. In
general, processing a command from a previous game seems very likely to
be a bad idea and unlikely to be good.
It is a file for internal renderer APIs.
It returns how many entities have been added to the current scene, but
there is nothing useful the cgame can do with this number. All the APIs
with entity id require adding the entity to the cache to get an id, not
to the scene.
Have the client drop the connection in these cases:
- A gamestate that decreases the sequence number. This should be
  impossible because the netchan guarantees that packets can't be
  reordered, although they may be dropped.
- A server command which a sequence number higher than the next one.
  This should be impossible because the server re-sends all
  unacknowledged commands together each time. If the number jumped by
  more than one the client would end up re-executing old garbage from
  the buffer.
A special case to allow demos to request bad command ranges is not
needed. The gamestate generated when starting the demo sets the
serverCommandSequence number appropriately, so the demo replay will be
able to request the correct range.
It should return a response with the expected number of items.
It could be annoying when following the call hierarchy across the
function pointers, if the functions have different name than the
function pointers.
When names are looked up in hash tables, the equality testing is done
with stricmp; there is no special behavior for backslashes. So it is
wrong to treat them specially in the hash function: the hashing and
equality functions should go hand-in-hand.
Remove initial slashes or multiple consecutive slashes and convert \ to
/ when looking up shaders or images. Useful for Smokin' Guns assets.
@illwieckz illwieckz force-pushed the illwieckz/shader-dump-line-numbering branch from 983d178 to f2b6520 Compare May 8, 2026 20:06
- reset line number at GLSL shader start
- use custom line number for the GLSL header to avoid line number duplicates
- use custom line number for the deform vertex header
- reset line count on `#line 0`
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.

4 participants