diff options
author | Dudemanguy <random342@airmail.cc> | 2023-10-11 15:04:47 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-10-16 15:38:59 +0000 |
commit | 39b9635305e84b57520be5e030d3dc3f241ba7df (patch) | |
tree | c0b340c2a38006b3ada255db030a2cfa8cd14e3c | |
parent | 92976b1e8caf734815d6b3f89bb5e30c6325c86d (diff) | |
download | mpv-39b9635305e84b57520be5e030d3dc3f241ba7df.tar.bz2 mpv-39b9635305e84b57520be5e030d3dc3f241ba7df.tar.xz |
vo: convert some final low-hanging things to nanoseconds
-rw-r--r-- | video/out/cocoa_common.m | 2 | ||||
-rw-r--r-- | video/out/d3d11/ra_d3d11.c | 20 |
2 files changed, 11 insertions, 11 deletions
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index a5b8e3b2f4..63427ba652 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -786,7 +786,7 @@ static void vo_cocoa_resize_redraw(struct vo *vo, int width, int height) // Wait until a new frame with the new size was rendered. For some reason, // Cocoa requires this to be done before drawRect() returns. - struct timespec e = mp_time_us_to_realtime(mp_time_us_add(mp_time_us(), 0.1)); + struct timespec e = mp_time_ns_to_realtime(mp_time_ns_add(mp_time_ns(), 0.1)); while (s->frame_w != width && s->frame_h != height && s->vo_ready) { if (pthread_cond_timedwait(&s->wakeup, &s->lock, &e)) break; diff --git a/video/out/d3d11/ra_d3d11.c b/video/out/d3d11/ra_d3d11.c index c002d8aad3..8a48040e2c 100644 --- a/video/out/d3d11/ra_d3d11.c +++ b/video/out/d3d11/ra_d3d11.c @@ -1322,13 +1322,13 @@ static bool compile_glsl(struct ra *ra, enum glsl_shader type, sc_shader_model = 40; } - int64_t start_us = mp_time_us(); + int64_t start_ns = mp_time_ns(); bstr spv_module; if (!spirv->fns->compile_glsl(spirv, ta_ctx, type, glsl, &spv_module)) goto done; - int64_t shaderc_us = mp_time_us(); + int64_t shaderc_ns = mp_time_ns(); sc_res = spvc_context_create(&sc_ctx); if (sc_res != SPVC_SUCCESS) @@ -1367,7 +1367,7 @@ static bool compile_glsl(struct ra *ra, enum glsl_shader type, if (sc_res != SPVC_SUCCESS) goto done; - int64_t cross_us = mp_time_us(); + int64_t cross_ns = mp_time_ns(); hr = p->D3DCompile(hlsl, strlen(hlsl), NULL, NULL, NULL, "main", get_shader_target(ra, type), D3DCOMPILE_OPTIMIZATION_LEVEL3, 0, out, @@ -1379,14 +1379,14 @@ static bool compile_glsl(struct ra *ra, enum glsl_shader type, goto done; } - int64_t d3dcompile_us = mp_time_us(); + int64_t d3dcompile_ns = mp_time_ns(); - MP_VERBOSE(ra, "Compiled a %s shader in %lldus\n", shader_type_name(type), - d3dcompile_us - start_us); - MP_VERBOSE(ra, "shaderc: %lldus, SPIRV-Cross: %lldus, D3DCompile: %lldus\n", - shaderc_us - start_us, - cross_us - shaderc_us, - d3dcompile_us - cross_us); + MP_VERBOSE(ra, "Compiled a %s shader in %lldns\n", shader_type_name(type), + d3dcompile_ns - start_ns); + MP_VERBOSE(ra, "shaderc: %lldns, SPIRV-Cross: %lldns, D3DCompile: %lldns\n", + shaderc_ns - start_ns, + cross_ns - shaderc_ns, + d3dcompile_ns - cross_ns); success = true; done: |