mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-11-27 04:04:23 +08:00
brw,elk: Fix opening flags on dumping shader binaries
Truncation is needed for overwriting correctly in cases when old file is bigger than the one we want to dump (e.g. when the old one was edited inplace). Also, creation permissions are way too broad. Fixes:4f41c44d
("intel/compiler: Add variable to dump binaries of all compiled shaders") Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30581> (cherry picked from commit09122e2be0
)
This commit is contained in:
parent
54db037efb
commit
d9608d4a52
@ -244,7 +244,7 @@
|
||||
"description": "brw,elk: Fix opening flags on dumping shader binaries",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "4f41c44df22116d351d06c3a03711e8ee68a7869",
|
||||
"notes": null
|
||||
|
@ -310,7 +310,7 @@ void brw_dump_shader_bin(void *assembly, int start_offset, int end_offset,
|
||||
debug_get_option_shader_bin_dump_path(),
|
||||
identifier);
|
||||
|
||||
int fd = open(name, O_CREAT | O_WRONLY, 0777);
|
||||
int fd = open(name, O_CREAT | O_WRONLY | O_TRUNC, 0644);
|
||||
ralloc_free(name);
|
||||
|
||||
if (fd < 0)
|
||||
|
@ -376,7 +376,7 @@ void elk_dump_shader_bin(void *assembly, int start_offset, int end_offset,
|
||||
debug_get_option_shader_bin_dump_path(),
|
||||
identifier);
|
||||
|
||||
int fd = open(name, O_CREAT | O_WRONLY, 0777);
|
||||
int fd = open(name, O_CREAT | O_WRONLY | O_TRUNC, 0644);
|
||||
ralloc_free(name);
|
||||
|
||||
if (fd < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user