mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-24 20:51:35 +00:00
[vulkan] Increase matrix id bits
I had missed that upping max lights to 2048 meant that up to 12288 matrices are needed for all the possible lights. This made it so the light type could not be encoded in id_data, but the shaders never used it anyway. This leaves one bit free.
This commit is contained in:
parent
39616bc84d
commit
7506117e43
3 changed files with 9 additions and 8 deletions
|
@ -60,7 +60,7 @@ enum {
|
|||
};
|
||||
|
||||
typedef struct qfv_light_render_s {
|
||||
// mat_id (0,13) map_id (13,5) layer (18,11) type (29,2)
|
||||
// mat_id (0,14) map_id (14,5) layer (19,11) nostyle (31,1)
|
||||
uint32_t id_data;
|
||||
// light style (6)
|
||||
uint32_t style;
|
||||
|
|
|
@ -48,9 +48,9 @@ main (void)
|
|||
float I = (1 - a.w * r.y) / dot (a, r);
|
||||
|
||||
uint id_data = renderer[id].id_data;
|
||||
uint mat_id = bitfieldExtract (id_data, 0, 13);
|
||||
uint map_id = bitfieldExtract (id_data, 13, 5);
|
||||
uint layer = bitfieldExtract (id_data, 18, 11);
|
||||
uint mat_id = bitfieldExtract (id_data, 0, 14);
|
||||
uint map_id = bitfieldExtract (id_data, 14, 5);
|
||||
uint layer = bitfieldExtract (id_data, 19, 11);
|
||||
|
||||
I *= shadow (map_id, layer, mat_id, p, l.position.xyz);
|
||||
|
||||
|
|
|
@ -335,12 +335,13 @@ make_id (uint32_t matrix_index, uint32_t map_index, uint32_t layer,
|
|||
uint32_t type)
|
||||
{
|
||||
if (type == ST_CUBE) {
|
||||
// on the GPU, layer is the cube layer, and one cube layer is 6
|
||||
// flat image layers
|
||||
layer /= 6;
|
||||
}
|
||||
return ((matrix_index & 0x1fff) << 0)
|
||||
| ((map_index & 0x1f) << 13)
|
||||
| ((layer & 0x7ff) << 18)
|
||||
| ((type & 3) << 29);
|
||||
return ((matrix_index & 0x3fff) << 0)
|
||||
| ((map_index & 0x1f) << 14)
|
||||
| ((layer & 0x7ff) << 19);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue