зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1678186 - Fix up draw call timing and move under PRINT_TIMINGS. r=lsalzman
This also prints the shader name Differential Revision: https://phabricator.services.mozilla.com/D97517
This commit is contained in:
Родитель
73a40153e2
Коммит
bd97027076
|
@ -22,6 +22,8 @@
|
||||||
# define debugf(...) printf(__VA_ARGS__)
|
# define debugf(...) printf(__VA_ARGS__)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// #define PRINT_TIMINGS
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
# define ALWAYS_INLINE __forceinline
|
# define ALWAYS_INLINE __forceinline
|
||||||
# define NO_INLINE __declspec(noinline)
|
# define NO_INLINE __declspec(noinline)
|
||||||
|
@ -4021,8 +4023,8 @@ void DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type,
|
||||||
v.validate();
|
v.validate();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifdef PRINT_TIMINGS
|
||||||
// uint64_t start = get_time_value();
|
uint64_t start = get_time_value();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ctx->shaded_rows = 0;
|
ctx->shaded_rows = 0;
|
||||||
|
@ -4074,17 +4076,22 @@ void DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type,
|
||||||
q.value += ctx->shaded_pixels;
|
q.value += ctx->shaded_pixels;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifdef PRINT_TIMINGS
|
||||||
// uint64_t end = get_time_value();
|
uint64_t end = get_time_value();
|
||||||
// debugf("draw(%d): %fms for %d pixels in %d rows (avg %f pixels/row, %f
|
printf("draw(%s, %d): %fms for %d pixels in %d rows (avg %f pixels/row, %fns/pixel)\n",
|
||||||
// ns/pixel)\n", instancecount, double(end - start)/(1000.*1000.),
|
ctx->programs[ctx->current_program].impl->get_name(),
|
||||||
// ctx->shaded_pixels, ctx->shaded_rows,
|
instancecount, double(end - start)/(1000.*1000.),
|
||||||
// double(ctx->shaded_pixels)/ctx->shaded_rows, double(end -
|
ctx->shaded_pixels, ctx->shaded_rows,
|
||||||
// start)/max(ctx->shaded_pixels, 1));
|
double(ctx->shaded_pixels)/ctx->shaded_rows,
|
||||||
|
double(end - start)/max(ctx->shaded_pixels, 1));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Finish() {}
|
void Finish() {
|
||||||
|
#ifdef PRINT_TIMINGS
|
||||||
|
printf("Finish\n");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void MakeCurrent(Context* c) {
|
void MakeCurrent(Context* c) {
|
||||||
if (ctx == c) {
|
if (ctx == c) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче