impl. normal vector rendering. working

This commit is contained in:
Dennis Eichhorn 2024-11-10 23:14:15 +01:00
parent 2149c82b63
commit 39714d68a8
3 changed files with 25 additions and 2 deletions

View File

@ -51,6 +51,19 @@ void update_timing_stat_end(uint32 stat, const char* function)
debug_container->perf_stats[stat].old_tick_count = new_tick_count;
}
inline
void update_timing_stat_end_continued(uint32 stat, const char* function)
{
uint64 new_tick_count = __rdtsc();
debug_container->perf_stats[stat].function = function;
debug_container->perf_stats[stat].delta_tick = debug_container->perf_stats[stat].delta_tick
+ new_tick_count - debug_container->perf_stats[stat].old_tick_count;
debug_container->perf_stats[stat].delta_time = debug_container->perf_stats[stat].delta_time
+ (double) debug_container->perf_stats[stat].delta_tick / (double) debug_container->performance_count_frequency;
debug_container->perf_stats[stat].old_tick_count = new_tick_count;
}
inline
void reset_counter(int32 id)
{

View File

@ -36,12 +36,17 @@ struct TimingStat {
// These are only needed if we need to delay the overwrite by 1 frame (e.g. ui update)
void update_timing_stat_start(uint32, const char*);
void update_timing_stat_end(uint32, const char*);
void update_timing_stat_end_continued(uint32, const char*);
#define UPDATE_TIMING_STAT_START(stat) update_timing_stat_start(stat, __func__)
#define UPDATE_TIMING_STAT_END(stat) update_timing_stat_end(stat, __func__)
#define UPDATE_TIMING_STAT_CONTINUE(stat) update_timing_stat_start(stat, __func__)
#define UPDATE_TIMING_STAT_END_CONTINUED(stat) update_timing_stat_end(stat, __func__)
#else
#define UPDATE_TIMING_STAT(stat) ((void) 0)
#define UPDATE_TIMING_STAT_START(stat) ((void) 0)
#define UPDATE_TIMING_STAT_END(stat) ((void) 0)
#define UPDATE_TIMING_STAT_CONTINUE(stat) ((void) 0)
#define UPDATE_TIMING_STAT_END_CONTINUED(stat) ((void) 0)
#endif
#endif

View File

@ -18,6 +18,11 @@ struct Vertex3D {
v4_f32 color;
};
struct Vertex3DNormal {
v3_f32 position;
v3_f32 normal;
};
struct Vertex3DTextureColor {
v3_f32 position;
v2_f32 tex_coord;
@ -27,12 +32,12 @@ struct Vertex3DTextureColor {
struct Vertex3DTextureColorIndex {
v3_f32 position;
v2_f32 tex_coord;
uint32 color;
f32 color;
};
struct Vertex3DColorIndex {
v3_f32 position;
uint32 color;
f32 color;
};
struct Vertex2D {