Quake II RTX doxygen  1.0 dev
vertex_buffer.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2018 Christoph Schied
3 Copyright (C) 2019, NVIDIA CORPORATION. All rights reserved.
4 
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19 
20 #ifndef _VERTEX_BUFFER_H_
21 #define _VERTEX_BUFFER_H_
22 
23 #define MAX_VERT_BSP (1 << 21)
24 
25 #define MAX_VERT_MODEL (1 << 22)
26 #define MAX_IDX_MODEL (1 << 22)
27 #define MAX_PRIM_MODEL (MAX_IDX_MODEL / 3)
28 
29 #define MAX_VERT_INSTANCED (1 << 21)
30 #define MAX_IDX_INSTANCED (MAX_VERT_INSTANCED / 3)
31 
32 #define MAX_LIGHT_LISTS (1 << 14)
33 #define MAX_LIGHT_LIST_NODES (1 << 19)
34 
35 #define MAX_LIGHT_POLYS 4096
36 #define LIGHT_POLY_VEC4S 4
37 
38 // should match the same constant declared in material.h
39 #define MAX_PBR_MATERIALS 4096
40 
41 #define LIGHT_TEXTURE_SCALE 0
42 
43 #define ALIGN_SIZE_4(x, n) ((x * n + 3) & (~3))
44 
45 #define VERTEX_BUFFER_BINDING_IDX 0
46 #define LIGHT_BUFFER_BINDING_IDX 1
47 #define READBACK_BUFFER_BINDING_IDX 2
48 #define TONE_MAPPING_BUFFER_BINDING_IDX 3
49 #define SUN_COLOR_BUFFER_BINDING_IDX 4
50 #define SUN_COLOR_UBO_BINDING_IDX 5
51 #define LIGHT_STATS_BUFFER_BINDING_IDX 6
52 
53 #define SUN_COLOR_ACCUMULATOR_FIXED_POINT_SCALE 0x100000
54 #define SKY_COLOR_ACCUMULATOR_FIXED_POINT_SCALE 0x100
55 
56 #ifdef VKPT_SHADER
57 #define uint32_t uint
58 #endif
59 
60 #define VERTEX_BUFFER_LIST \
61  VERTEX_BUFFER_LIST_DO(float, 3, positions_bsp, (MAX_VERT_BSP )) \
62  VERTEX_BUFFER_LIST_DO(float, 2, tex_coords_bsp, (MAX_VERT_BSP )) \
63  VERTEX_BUFFER_LIST_DO(float, 3, tangents_bsp, (MAX_VERT_BSP / 3 )) \
64  VERTEX_BUFFER_LIST_DO(uint32_t, 1, materials_bsp, (MAX_VERT_BSP / 3 )) \
65  VERTEX_BUFFER_LIST_DO(uint32_t, 1, clusters_bsp, (MAX_VERT_BSP / 3 )) \
66  VERTEX_BUFFER_LIST_DO(float, 1, texel_density_bsp, (MAX_VERT_BSP / 3 )) \
67  \
68  VERTEX_BUFFER_LIST_DO(float, 3, positions_model, (MAX_VERT_MODEL )) \
69  VERTEX_BUFFER_LIST_DO(float, 3, normals_model, (MAX_VERT_MODEL )) \
70  VERTEX_BUFFER_LIST_DO(float, 2, tex_coords_model, (MAX_VERT_MODEL )) \
71  VERTEX_BUFFER_LIST_DO(float, 4, tangents_model, (MAX_VERT_MODEL )) \
72  VERTEX_BUFFER_LIST_DO(uint32_t, 3, idx_model, (MAX_IDX_MODEL )) \
73  \
74  VERTEX_BUFFER_LIST_DO(float, 3, positions_instanced, (MAX_VERT_MODEL )) \
75  VERTEX_BUFFER_LIST_DO(float, 3, pos_prev_instanced, (MAX_VERT_MODEL )) \
76  VERTEX_BUFFER_LIST_DO(float, 3, normals_instanced, (MAX_VERT_MODEL )) \
77  VERTEX_BUFFER_LIST_DO(float, 3, tangents_instanced, (MAX_PRIM_MODEL )) \
78  VERTEX_BUFFER_LIST_DO(float, 2, tex_coords_instanced, (MAX_VERT_MODEL )) \
79  VERTEX_BUFFER_LIST_DO(float, 1, alpha_instanced, (MAX_PRIM_MODEL )) \
80  VERTEX_BUFFER_LIST_DO(uint32_t, 1, clusters_instanced, (MAX_PRIM_MODEL )) \
81  VERTEX_BUFFER_LIST_DO(uint32_t, 1, materials_instanced, (MAX_PRIM_MODEL )) \
82  VERTEX_BUFFER_LIST_DO(uint32_t, 1, instance_id_instanced, (MAX_PRIM_MODEL )) \
83  VERTEX_BUFFER_LIST_DO(float, 1, texel_density_instanced, (MAX_PRIM_MODEL )) \
84  \
85  VERTEX_BUFFER_LIST_DO(uint32_t, 1, sky_visibility, (MAX_LIGHT_LISTS / 32)) \
86 
87 
88 #define LIGHT_BUFFER_LIST \
89  LIGHT_BUFFER_LIST_DO(uint32_t, 4, material_table, (MAX_PBR_MATERIALS)) \
90  LIGHT_BUFFER_LIST_DO(float, 4, light_polys, (MAX_LIGHT_POLYS * LIGHT_POLY_VEC4S)) \
91  LIGHT_BUFFER_LIST_DO(uint32_t, 1, light_list_offsets, (MAX_LIGHT_LISTS )) \
92  LIGHT_BUFFER_LIST_DO(uint32_t, 1, light_list_lights, (MAX_LIGHT_LIST_NODES)) \
93  LIGHT_BUFFER_LIST_DO(float, 1, light_styles, (MAX_LIGHT_STYLES )) \
94  LIGHT_BUFFER_LIST_DO(uint32_t, 1, cluster_debug_mask, (MAX_LIGHT_LISTS / 32)) \
95 
97 {
98 #define VERTEX_BUFFER_LIST_DO(type, dim, name, size) \
99  type name[ALIGN_SIZE_4(size, dim)];
100 
102 
103 #undef VERTEX_BUFFER_LIST_DO
104 };
105 
107 {
108 #define LIGHT_BUFFER_LIST_DO(type, dim, name, size) \
109  type name[ALIGN_SIZE_4(size, dim)];
110 
112 
113 #undef LIGHT_BUFFER_LIST_DO
114 };
115 
117 {
122  float tonecurve;
123 };
124 
125 #ifndef VKPT_SHADER
126 typedef int ivec3_t[3];
127 typedef int ivec4_t[4];
128 #else
129 #define ivec3_t ivec3
130 #define ivec4_t ivec4
131 #define vec3_t vec3
132 #endif
133 
135 {
136  uint32_t material;
137  uint32_t cluster;
140  vec3_t hdr_color;
142 };
143 
145 {
147  int padding1;
148 
150 
151  vec3_t sun_color;
153 
154  vec3_t sky_color;
156 };
157 
158 #ifndef VKPT_SHADER
159 typedef struct VertexBuffer VertexBuffer;
160 typedef struct LightBuffer LightBuffer;
164 #endif
165 
166 #ifdef VKPT_SHADER
167 
168 struct MaterialInfo
169 {
170  uint diffuse_texture;
171  uint normals_texture;
172  uint emissive_texture;
173  float bump_scale;
174  float roughness_override;
175  float specular_scale;
176  float emissive_scale;
177  float light_style_scale;
178  uint num_frames;
179  uint next_frame;
180 };
181 
182 struct LightPolygon
183 {
184  mat3 positions;
185  vec3 color;
186  float light_style_scale;
187  float prev_style_scale;
188 };
189 
190 #ifdef VERTEX_READONLY
191 layout(set = VERTEX_BUFFER_DESC_SET_IDX, binding = VERTEX_BUFFER_BINDING_IDX) readonly buffer VERTEX_BUFFER {
192  VertexBuffer vbo;
193 };
194 #else
195 layout(set = VERTEX_BUFFER_DESC_SET_IDX, binding = VERTEX_BUFFER_BINDING_IDX) buffer VERTEX_BUFFER {
196  VertexBuffer vbo;
197 };
198 #endif
199 
200 layout(set = VERTEX_BUFFER_DESC_SET_IDX, binding = LIGHT_BUFFER_BINDING_IDX) readonly buffer LIGHT_BUFFER {
201  LightBuffer lbo;
202 };
203 
204 layout(set = VERTEX_BUFFER_DESC_SET_IDX, binding = READBACK_BUFFER_BINDING_IDX) buffer READBACK_BUFFER {
205  ReadbackBuffer readback;
206 };
207 
208 layout(set = VERTEX_BUFFER_DESC_SET_IDX, binding = TONE_MAPPING_BUFFER_BINDING_IDX) buffer TONE_MAPPING_BUFFER {
209  ToneMappingBuffer tonemap_buffer;
210 };
211 
212 layout(set = VERTEX_BUFFER_DESC_SET_IDX, binding = SUN_COLOR_BUFFER_BINDING_IDX) buffer SUN_COLOR_BUFFER {
213  SunColorBuffer sun_color_buffer;
214 };
215 
216 layout(set = VERTEX_BUFFER_DESC_SET_IDX, binding = SUN_COLOR_UBO_BINDING_IDX, std140) uniform SUN_COLOR_UBO {
217  SunColorBuffer sun_color_ubo;
218 };
219 
220 layout(set = VERTEX_BUFFER_DESC_SET_IDX, binding = LIGHT_STATS_BUFFER_BINDING_IDX) buffer LIGHT_STATS_BUFFERS {
221  uint stats[];
222 } light_stats_bufers[3];
223 
224 
225 #define GET_float_1(buf,name) \
226 float \
227 get_##name(uint idx) \
228 { \
229  return buf.name[idx]; \
230 }
231 
232 #define GET_float_2(buf,name) \
233 vec2 \
234 get_##name(uint idx) \
235 { \
236  return vec2(buf.name[idx * 2 + 0], buf.name[idx * 2 + 1]); \
237 }
238 
239 #define GET_float_3(buf,name) \
240 vec3 \
241 get_##name(uint idx) \
242 { \
243  return vec3(buf.name[idx * 3 + 0], buf.name[idx * 3 + 1], buf.name[idx * 3 + 2]); \
244 }
245 
246 #define GET_float_4(buf,name) \
247 vec4 \
248 get_##name(uint idx) \
249 { \
250  return vec4(buf.name[idx * 4 + 0], buf.name[idx * 4 + 1], buf.name[idx * 4 + 2], buf.name[idx * 4 + 3]); \
251 }
252 
253 #define GET_uint32_t_1(buf,name) \
254 uint \
255 get_##name(uint idx) \
256 { \
257  return buf.name[idx]; \
258 }
259 
260 #define GET_uint32_t_3(buf,name) \
261 uvec3 \
262 get_##name(uint idx) \
263 { \
264  return uvec3(buf.name[idx * 3 + 0], buf.name[idx * 3 + 1], buf.name[idx * 3 + 2]); \
265 }
266 
267 #define GET_uint32_t_4(buf,name) \
268 uvec4 \
269 get_##name(uint idx) \
270 { \
271  return uvec4(buf.name[idx * 4 + 0], buf.name[idx * 4 + 1], buf.name[idx * 4 + 2], buf.name[idx * 4 + 3]); \
272 }
273 
274 #ifndef VERTEX_READONLY
275 #define SET_float_1(buf,name) \
276 void \
277 set_##name(uint idx, float v) \
278 { \
279  buf.name[idx] = v; \
280 }
281 
282 #define SET_float_2(buf,name) \
283 void \
284 set_##name(uint idx, vec2 v) \
285 { \
286  buf.name[idx * 2 + 0] = v[0]; \
287  buf.name[idx * 2 + 1] = v[1]; \
288 }
289 
290 #define SET_float_3(buf,name) \
291 void \
292 set_##name(uint idx, vec3 v) \
293 { \
294  buf.name[idx * 3 + 0] = v[0]; \
295  buf.name[idx * 3 + 1] = v[1]; \
296  buf.name[idx * 3 + 2] = v[2]; \
297 }
298 
299 #define SET_float_4(buf,name) \
300 void \
301 set_##name(uint idx, vec4 v) \
302 { \
303  buf.name[idx * 4 + 0] = v[0]; \
304  buf.name[idx * 4 + 1] = v[1]; \
305  buf.name[idx * 4 + 2] = v[2]; \
306  buf.name[idx * 4 + 3] = v[3]; \
307 }
308 
309 #define SET_uint32_t_1(buf,name) \
310 void \
311 set_##name(uint idx, uint u) \
312 { \
313  buf.name[idx] = u; \
314 }
315 
316 #define SET_uint32_t_3(buf,name) \
317 void \
318 set_##name(uint idx, uvec3 v) \
319 { \
320  buf.name[idx * 3 + 0] = v[0]; \
321  buf.name[idx * 3 + 1] = v[1]; \
322  buf.name[idx * 3 + 2] = v[2]; \
323 }
324 #endif
325 
326 #ifdef VERTEX_READONLY
327 #define VERTEX_BUFFER_LIST_DO(type, dim, name, size) \
328  GET_##type##_##dim(vbo,name)
330 #undef VERTEX_BUFFER_LIST_DO
331 #else
332 #define VERTEX_BUFFER_LIST_DO(type, dim, name, size) \
333  GET_##type##_##dim(vbo,name) \
334  SET_##type##_##dim(vbo,name)
336 #undef VERTEX_BUFFER_LIST_DO
337 #endif
338 
339 #define LIGHT_BUFFER_LIST_DO(type, dim, name, size) \
340  GET_##type##_##dim(lbo,name)
342 #undef LIGHT_BUFFER_LIST_DO
343 
344 struct Triangle
345 {
346  mat3x3 positions;
347  mat3x3 positions_prev;
348  mat3x3 normals;
349  mat3x2 tex_coords;
350  vec3 tangent;
351  uint material_id;
352  uint cluster;
353  float alpha;
354  float texel_density;
355 };
356 
357 Triangle
358 get_bsp_triangle(uint prim_id)
359 {
360  Triangle t;
361  t.positions[0] = get_positions_bsp(prim_id * 3 + 0);
362  t.positions[1] = get_positions_bsp(prim_id * 3 + 1);
363  t.positions[2] = get_positions_bsp(prim_id * 3 + 2);
364 
365  t.positions_prev = t.positions;
366 
367  vec3 normal = normalize(cross(
368  t.positions[1] - t.positions[0],
369  t.positions[2] - t.positions[0]));
370 
371  t.normals[0] = normal;
372  t.normals[1] = normal;
373  t.normals[2] = normal;
374 
375  t.tex_coords[0] = get_tex_coords_bsp(prim_id * 3 + 0);
376  t.tex_coords[1] = get_tex_coords_bsp(prim_id * 3 + 1);
377  t.tex_coords[2] = get_tex_coords_bsp(prim_id * 3 + 2);
378 
379  t.tangent = get_tangents_bsp(prim_id);
380 
381  t.material_id = get_materials_bsp(prim_id);
382 
383  t.cluster = get_clusters_bsp(prim_id);
384 
385  t.texel_density = get_texel_density_bsp(prim_id);
386 
387  t.alpha = 1.0;
388 
389  return t;
390 }
391 
392 Triangle
393 get_model_triangle(uint prim_id, uint idx_offset, uint vert_offset)
394 {
395  uvec3 idx = get_idx_model(prim_id + idx_offset / 3);
396  idx += vert_offset;
397 
398  Triangle t;
399  t.positions[0] = get_positions_model(idx[0]);
400  t.positions[1] = get_positions_model(idx[1]);
401  t.positions[2] = get_positions_model(idx[2]);
402 
403  t.normals[0] = get_normals_model(idx[0]);
404  t.normals[1] = get_normals_model(idx[1]);
405  t.normals[2] = get_normals_model(idx[2]);
406 
407  t.tex_coords[0] = get_tex_coords_model(idx[0]);
408  t.tex_coords[1] = get_tex_coords_model(idx[1]);
409  t.tex_coords[2] = get_tex_coords_model(idx[2]);
410 
411  vec4 tangent = get_tangents_model(idx[0]);
412  t.tangent = tangent.xyz;
413 
414  t.material_id = 0; // needs to come from uniform buffer
415  if(tangent.w < 0)
416  t.material_id |= MATERIAL_FLAG_HANDEDNESS;
417 
418  t.alpha = 1.0;
419  t.texel_density = 0;
420 
421  return t;
422 }
423 
424 Triangle
425 get_instanced_triangle(uint prim_id)
426 {
427  Triangle t;
428  t.positions[0] = get_positions_instanced(prim_id * 3 + 0);
429  t.positions[1] = get_positions_instanced(prim_id * 3 + 1);
430  t.positions[2] = get_positions_instanced(prim_id * 3 + 2);
431 
432  t.positions_prev[0] = get_pos_prev_instanced(prim_id * 3 + 0);
433  t.positions_prev[1] = get_pos_prev_instanced(prim_id * 3 + 1);
434  t.positions_prev[2] = get_pos_prev_instanced(prim_id * 3 + 2);
435 
436  t.normals[0] = get_normals_instanced(prim_id * 3 + 0);
437  t.normals[1] = get_normals_instanced(prim_id * 3 + 1);
438  t.normals[2] = get_normals_instanced(prim_id * 3 + 2);
439 
440  t.tangent = get_tangents_instanced(prim_id);
441 
442  t.tex_coords[0] = get_tex_coords_instanced(prim_id * 3 + 0);
443  t.tex_coords[1] = get_tex_coords_instanced(prim_id * 3 + 1);
444  t.tex_coords[2] = get_tex_coords_instanced(prim_id * 3 + 2);
445 
446  t.material_id = get_materials_instanced(prim_id);
447 
448  t.cluster = get_clusters_instanced(prim_id);
449 
450  t.alpha = get_alpha_instanced(prim_id);
451 
452  t.texel_density = get_texel_density_instanced(prim_id);
453 
454  return t;
455 }
456 
457 #ifndef VERTEX_READONLY
458 void
459 store_instanced_triangle(Triangle t, uint instance_id, uint prim_id)
460 {
461  set_positions_instanced(prim_id * 3 + 0, t.positions[0]);
462  set_positions_instanced(prim_id * 3 + 1, t.positions[1]);
463  set_positions_instanced(prim_id * 3 + 2, t.positions[2]);
464 
465  set_pos_prev_instanced(prim_id * 3 + 0, t.positions_prev[0]);
466  set_pos_prev_instanced(prim_id * 3 + 1, t.positions_prev[1]);
467  set_pos_prev_instanced(prim_id * 3 + 2, t.positions_prev[2]);
468 
469  set_normals_instanced(prim_id * 3 + 0, t.normals[0]);
470  set_normals_instanced(prim_id * 3 + 1, t.normals[1]);
471  set_normals_instanced(prim_id * 3 + 2, t.normals[2]);
472 
473  set_tangents_instanced(prim_id, t.tangent);
474 
475  set_tex_coords_instanced(prim_id * 3 + 0, t.tex_coords[0]);
476  set_tex_coords_instanced(prim_id * 3 + 1, t.tex_coords[1]);
477  set_tex_coords_instanced(prim_id * 3 + 2, t.tex_coords[2]);
478 
479  set_materials_instanced(prim_id, t.material_id);
480 
481  set_instance_id_instanced(prim_id, instance_id);
482 
483  set_clusters_instanced(prim_id, t.cluster);
484 
485  set_alpha_instanced(prim_id, t.alpha);
486 
487  set_texel_density_instanced(prim_id, t.texel_density);
488 }
489 #endif
490 
491 MaterialInfo
492 get_material_info(uint material_id)
493 {
494  uvec4 data = get_material_table(material_id & MATERIAL_INDEX_MASK);
495 
496  MaterialInfo minfo;
497  minfo.diffuse_texture = data.x & 0xffff;
498  minfo.normals_texture = data.x >> 16;
499  minfo.emissive_texture = data.y & 0xffff;
500  minfo.num_frames = (data.y >> 28) & 0x000f;
501  minfo.next_frame = (data.y >> 16) & 0x0fff;
502  minfo.bump_scale = unpackHalf2x16(data.z).x;
503  minfo.roughness_override = unpackHalf2x16(data.z).y;
504  minfo.specular_scale = unpackHalf2x16(data.w).x;
505  minfo.emissive_scale = unpackHalf2x16(data.w).y;
506 
507  // Apply the light style for non-camera materials.
508  // Camera materials use the same bits to store the camera ID.
509  if((material_id & MATERIAL_KIND_MASK) != MATERIAL_KIND_CAMERA)
510  {
511  uint light_style = (material_id & MATERIAL_LIGHT_STYLE_MASK) >> MATERIAL_LIGHT_STYLE_SHIFT;
512  if(light_style != 0)
513  {
514  minfo.emissive_scale *= get_light_styles(light_style);
515  }
516  }
517 
518  return minfo;
519 }
520 
521 LightPolygon
522 get_light_polygon(uint index)
523 {
524  vec4 p0 = get_light_polys(index * LIGHT_POLY_VEC4S + 0);
525  vec4 p1 = get_light_polys(index * LIGHT_POLY_VEC4S + 1);
526  vec4 p2 = get_light_polys(index * LIGHT_POLY_VEC4S + 2);
527  vec4 p3 = get_light_polys(index * LIGHT_POLY_VEC4S + 3);
528 
529  LightPolygon light;
530  light.positions = mat3x3(p0.xyz, p1.xyz, p2.xyz);
531  light.color = vec3(p0.w, p1.w, p2.w);
532  light.light_style_scale = p3.x;
533  light.prev_style_scale = p3.y;
534  return light;
535 }
536 
537 #endif
538 #endif
SUN_COLOR_UBO_BINDING_IDX
#define SUN_COLOR_UBO_BINDING_IDX
Definition: vertex_buffer.h:50
SUN_COLOR_BUFFER_BINDING_IDX
#define SUN_COLOR_BUFFER_BINDING_IDX
Definition: vertex_buffer.h:49
READBACK_BUFFER_BINDING_IDX
#define READBACK_BUFFER_BINDING_IDX
Definition: vertex_buffer.h:47
MATERIAL_LIGHT_STYLE_SHIFT
#define MATERIAL_LIGHT_STYLE_SHIFT
Definition: constants.h:85
SunColorBuffer::sun_color
vec3_t sun_color
Definition: vertex_buffer.h:151
ReadbackBuffer::cluster
uint32_t cluster
Definition: vertex_buffer.h:137
uint
uint32_t uint
Definition: global_ubo.h:233
MATERIAL_FLAG_HANDEDNESS
#define MATERIAL_FLAG_HANDEDNESS
Definition: constants.h:75
ToneMappingBuffer::curve
float curve[HISTOGRAM_BINS]
Definition: vertex_buffer.h:119
ReadbackBuffer::sky_luminance
float sky_luminance
Definition: vertex_buffer.h:139
LIGHT_POLY_VEC4S
#define LIGHT_POLY_VEC4S
Definition: vertex_buffer.h:36
VERTEX_BUFFER_BINDING_IDX
#define VERTEX_BUFFER_BINDING_IDX
Definition: vertex_buffer.h:45
SunColorBuffer::sun_luminance
float sun_luminance
Definition: vertex_buffer.h:152
layout
layout(set=GOD_RAYS_DESC_SET_IDX, binding=0) uniform sampler2DArray TEX_SHADOW_MAP
TONE_MAPPING_BUFFER_BINDING_IDX
#define TONE_MAPPING_BUFFER_BINDING_IDX
Definition: vertex_buffer.h:48
ivec4_t
int ivec4_t[4]
Definition: vertex_buffer.h:127
HISTOGRAM_BINS
#define HISTOGRAM_BINS
Definition: constants.h:29
ToneMappingBuffer::adapted_luminance
float adapted_luminance
Definition: vertex_buffer.h:121
LIGHT_BUFFER_BINDING_IDX
#define LIGHT_BUFFER_BINDING_IDX
Definition: vertex_buffer.h:46
ToneMappingBuffer
Definition: vertex_buffer.h:116
VERTEX_BUFFER_LIST
#define VERTEX_BUFFER_LIST
Definition: vertex_buffer.h:60
VERTEX_BUFFER_DESC_SET_IDX
#define VERTEX_BUFFER_DESC_SET_IDX
Definition: path_tracer_rgen.h:30
SunColorBuffer::sky_luminance
float sky_luminance
Definition: vertex_buffer.h:155
ReadbackBuffer::adapted_luminance
float adapted_luminance
Definition: vertex_buffer.h:141
MATERIAL_KIND_MASK
#define MATERIAL_KIND_MASK
Definition: constants.h:57
ReadbackBuffer
Definition: vertex_buffer.h:134
MATERIAL_LIGHT_STYLE_MASK
#define MATERIAL_LIGHT_STYLE_MASK
Definition: constants.h:84
LIGHT_STATS_BUFFER_BINDING_IDX
#define LIGHT_STATS_BUFFER_BINDING_IDX
Definition: vertex_buffer.h:51
MATERIAL_KIND_CAMERA
#define MATERIAL_KIND_CAMERA
Definition: constants.h:70
SunColorBuffer::accum_sun_color
ivec3_t accum_sun_color
Definition: vertex_buffer.h:146
ToneMappingBuffer::tonecurve
float tonecurve
Definition: vertex_buffer.h:122
LightBuffer
Definition: vertex_buffer.h:106
VertexBuffer
Definition: vertex_buffer.h:96
ToneMappingBuffer::accumulator
int accumulator[HISTOGRAM_BINS]
Definition: vertex_buffer.h:118
SunColorBuffer::sky_color
vec3_t sky_color
Definition: vertex_buffer.h:154
ivec3_t
int ivec3_t[3]
Definition: vertex_buffer.h:126
color
static vec4_t color
Definition: mesh.c:33
ReadbackBuffer::sun_luminance
float sun_luminance
Definition: vertex_buffer.h:138
MATERIAL_INDEX_MASK
#define MATERIAL_INDEX_MASK
Definition: constants.h:86
SunColorBuffer
Definition: vertex_buffer.h:144
SunColorBuffer::accum_sky_color
ivec4_t accum_sky_color
Definition: vertex_buffer.h:149
ReadbackBuffer::material
uint32_t material
Definition: vertex_buffer.h:136
ToneMappingBuffer::normalized
float normalized[HISTOGRAM_BINS]
Definition: vertex_buffer.h:120
LIGHT_BUFFER_LIST
#define LIGHT_BUFFER_LIST
Definition: vertex_buffer.h:88
ReadbackBuffer::hdr_color
vec3_t hdr_color
Definition: vertex_buffer.h:140
SunColorBuffer::padding1
int padding1
Definition: vertex_buffer.h:147