mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
llvmpipe: fix build on macOS due to st_mtim
macOS struct stat uses st_mtimespec instead of st_mtim. Use
st_mtimespec on Apple platforms to get nanosecond file modification
time.
Fixes: e68a0dfb12 ("llvmpipe: Implement manual context resets")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40791>
This commit is contained in:
parent
21952ffb07
commit
7f07783569
1 changed files with 5 additions and 0 deletions
|
|
@ -225,8 +225,13 @@ llvmpipe_get_device_reset_status(struct pipe_context *pipe)
|
|||
PIPE_UNKNOWN_CONTEXT_RESET : PIPE_NO_RESET;
|
||||
|
||||
if (stat(llvmpipe->context_reset_file_path, &st_reset_file) == 0) {
|
||||
#if defined(__APPLE__)
|
||||
int64_t file_mod_time_ns = (int64_t)st_reset_file.st_mtimespec.tv_sec *
|
||||
1000000000LL + st_reset_file.st_mtimespec.tv_nsec;
|
||||
#else
|
||||
int64_t file_mod_time_ns = (int64_t)st_reset_file.st_mtim.tv_sec *
|
||||
1000000000LL + st_reset_file.st_mtim.tv_nsec;
|
||||
#endif
|
||||
|
||||
if (llvmpipe->context_creation_time_ns < file_mod_time_ns) {
|
||||
llvmpipe->context_reset_time_ns = now_ns;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue