diff options
author | Andrzej Janik <[email protected]> | 2021-08-07 16:06:15 +0200 |
---|---|---|
committer | Andrzej Janik <[email protected]> | 2021-08-07 16:06:15 +0200 |
commit | 3ce6aee65d488e7b05ac504e2b0795c72cf52b12 (patch) | |
tree | 4cd06947005abea9df28376e124b0c37140a9e13 | |
parent | 3070d983abeae1a8560adca9194ad24d1d6356b4 (diff) | |
download | ZLUDA-3ce6aee65d488e7b05ac504e2b0795c72cf52b12.tar.gz ZLUDA-3ce6aee65d488e7b05ac504e2b0795c72cf52b12.zip |
Try seeking before reading
-rw-r--r-- | zluda/src/impl/module.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/zluda/src/impl/module.rs b/zluda/src/impl/module.rs index 3635d29..6ae4235 100644 --- a/zluda/src/impl/module.rs +++ b/zluda/src/impl/module.rs @@ -5,7 +5,7 @@ use std::{ ffi::c_void, ffi::CStr, ffi::CString, - io::{self, Read, Write}, + io::{self, Read, Seek, SeekFrom, Write}, mem, os::raw::{c_char, c_int, c_uint}, path::PathBuf, @@ -206,6 +206,7 @@ impl SpirvModule { let status = compiler_cmd.status()?; assert!(status.success()); let mut result = Vec::new(); + compiled_binary.seek(SeekFrom::Start(0))?; compiled_binary.read_to_end(&mut result)?; Ok(result) } |