mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 17:50:12 +01:00
compiler: use PATH_MAX for SPIR-V capture filename
Reviewed-by: Natalie Vock <natalie.vock@gmx.de> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36472>
This commit is contained in:
parent
9f893de953
commit
16a855ae61
1 changed files with 5 additions and 1 deletions
|
|
@ -45,6 +45,10 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#ifndef PATH_MAX
|
||||||
|
#define PATH_MAX 4096
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Table of all implemented capabilities. These are the capabilities that are
|
/* Table of all implemented capabilities. These are the capabilities that are
|
||||||
* implemented in the spirv_to_nir, not what the device supports.
|
* implemented in the spirv_to_nir, not what the device supports.
|
||||||
*
|
*
|
||||||
|
|
@ -343,7 +347,7 @@ vtn_dump_shader(struct vtn_builder *b, const char *path, const char *prefix)
|
||||||
{
|
{
|
||||||
static int idx = 0;
|
static int idx = 0;
|
||||||
|
|
||||||
char filename[1024];
|
char filename[PATH_MAX];
|
||||||
int len = snprintf(filename, sizeof(filename), "%s/%s-%d.spirv",
|
int len = snprintf(filename, sizeof(filename), "%s/%s-%d.spirv",
|
||||||
path, prefix, idx++);
|
path, prefix, idx++);
|
||||||
if (len < 0 || len >= sizeof(filename))
|
if (len < 0 || len >= sizeof(filename))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue