VReaperV · GitHub

@VReaperV

This was referenced

Dec 26, 2024

Closed

Merged

Merged

Merged

Closed

@VReaperV

@VReaperV

@VReaperV

@VReaperV

Closed

@VReaperV VReaperV linked an issue

Jan 14, 2025

that may be closed by this pull request

Closed

Merged

@VReaperV

slipher

@VReaperV

slipher

@VReaperV

Allocate memory for each stage of used shaders rather than for each stage in all used shaders for each surface that uses them. Change some of the material system functions to use `shaderStage_t*` instead of `drawSurf_t*` etc as input.
Textures are put into a different storage buffer, following the structure of `textureBundle_t`. This allows decreasing the total amount of memory used, and changing the material buffer to be a UBO instead. The lightmap and deluxemap handles are put into another UBO, because they're per-surface, rather than per-shader-stage.
Also moved some duplicate code into a function.
Only these 6 components (0, 1, 4, 5, 12, 13) actually have an effect. This largely reduces the amount of data being transferred for texture matrices, as well as some useless computations.
.
Also removed some now useless code.
Also fixes an incorrect matrix constructor in shaders.
The UBO bindings were conflicting with light UBO.
Also make it in line with other usages of `lightMap`.

@VReaperV

@VReaperV

@VReaperV

Read the original on github.com ↗