mirror of
https://github.com/libretro/RetroArch
synced 2025-01-29 00:32:49 +00:00
use strl functions
This commit is contained in:
parent
d3c6fc1601
commit
12539f310d
@ -393,20 +393,17 @@ static bool d3d10_gfx_set_shader(void* data,
|
||||
#endif
|
||||
static const char vs_ext[] = ".vs.hlsl";
|
||||
static const char ps_ext[] = ".ps.hlsl";
|
||||
char vs_path[PATH_MAX_LENGTH];
|
||||
char ps_path[PATH_MAX_LENGTH];
|
||||
char vs_path[PATH_MAX_LENGTH] = {0};
|
||||
char ps_path[PATH_MAX_LENGTH] = {0};
|
||||
const char* slang_path = d3d10->shader_preset->pass[i].source.path;
|
||||
const char* vs_src = d3d10->shader_preset->pass[i].source.string.vertex;
|
||||
const char* ps_src = d3d10->shader_preset->pass[i].source.string.fragment;
|
||||
int base_len = strlen(slang_path) - strlen(".slang");
|
||||
|
||||
if (base_len <= 0)
|
||||
base_len = strlen(slang_path);
|
||||
|
||||
strncpy(vs_path, slang_path, base_len);
|
||||
strncpy(ps_path, slang_path, base_len);
|
||||
strncpy(vs_path + base_len, vs_ext, sizeof(vs_ext));
|
||||
strncpy(ps_path + base_len, ps_ext, sizeof(ps_ext));
|
||||
strlcpy(vs_path, slang_path, sizeof(vs_path));
|
||||
strlcpy(ps_path, slang_path, sizeof(ps_path));
|
||||
strlcat(vs_path, vs_ext, sizeof(vs_path));
|
||||
strlcat(ps_path, ps_ext, sizeof(ps_path));
|
||||
|
||||
if (!d3d10_init_shader(
|
||||
d3d10->device, vs_src, 0, vs_path, "main", NULL, NULL, desc, countof(desc),
|
||||
|
@ -407,20 +407,16 @@ static bool d3d11_gfx_set_shader(void* data, enum rarch_shader_type type, const
|
||||
#endif
|
||||
static const char vs_ext[] = ".vs.hlsl";
|
||||
static const char ps_ext[] = ".ps.hlsl";
|
||||
char vs_path[PATH_MAX_LENGTH];
|
||||
char ps_path[PATH_MAX_LENGTH];
|
||||
char vs_path[PATH_MAX_LENGTH] = {0};
|
||||
char ps_path[PATH_MAX_LENGTH] = {0};
|
||||
const char* slang_path = d3d11->shader_preset->pass[i].source.path;
|
||||
const char* vs_src = d3d11->shader_preset->pass[i].source.string.vertex;
|
||||
const char* ps_src = d3d11->shader_preset->pass[i].source.string.fragment;
|
||||
int base_len = strlen(slang_path) - strlen(".slang");
|
||||
|
||||
if (base_len <= 0)
|
||||
base_len = strlen(slang_path);
|
||||
|
||||
strncpy(vs_path, slang_path, base_len);
|
||||
strncpy(ps_path, slang_path, base_len);
|
||||
strncpy(vs_path + base_len, vs_ext, sizeof(vs_ext));
|
||||
strncpy(ps_path + base_len, ps_ext, sizeof(ps_ext));
|
||||
strlcpy(vs_path, slang_path, sizeof(vs_path));
|
||||
strlcpy(ps_path, slang_path, sizeof(ps_path));
|
||||
strlcat(vs_path, vs_ext, sizeof(vs_path));
|
||||
strlcat(ps_path, ps_ext, sizeof(ps_path));
|
||||
|
||||
if (!d3d11_init_shader(
|
||||
d3d11->device, vs_src, 0, vs_path, "main", NULL, NULL, desc, countof(desc),
|
||||
|
@ -420,20 +420,17 @@ static bool d3d12_gfx_set_shader(void* data, enum rarch_shader_type type, const
|
||||
#endif
|
||||
static const char vs_ext[] = ".vs.hlsl";
|
||||
static const char ps_ext[] = ".ps.hlsl";
|
||||
char vs_path[PATH_MAX_LENGTH];
|
||||
char ps_path[PATH_MAX_LENGTH];
|
||||
char vs_path[PATH_MAX_LENGTH] = {0};
|
||||
char ps_path[PATH_MAX_LENGTH] = {0};
|
||||
const char* slang_path = d3d12->shader_preset->pass[i].source.path;
|
||||
const char* vs_src = d3d12->shader_preset->pass[i].source.string.vertex;
|
||||
const char* ps_src = d3d12->shader_preset->pass[i].source.string.fragment;
|
||||
int base_len = strlen(slang_path) - strlen(".slang");
|
||||
|
||||
if (base_len <= 0)
|
||||
base_len = strlen(slang_path);
|
||||
|
||||
strncpy(vs_path, slang_path, base_len);
|
||||
strncpy(ps_path, slang_path, base_len);
|
||||
strncpy(vs_path + base_len, vs_ext, sizeof(vs_ext));
|
||||
strncpy(ps_path + base_len, ps_ext, sizeof(ps_ext));
|
||||
strlcpy(vs_path, slang_path, sizeof(vs_path));
|
||||
strlcpy(ps_path, slang_path, sizeof(ps_path));
|
||||
strlcat(vs_path, vs_ext, sizeof(vs_path));
|
||||
strlcat(ps_path, ps_ext, sizeof(ps_path));
|
||||
|
||||
if (!d3d_compile(vs_src, 0, vs_path, "main", "vs_5_0", &vs_code))
|
||||
save_hlsl = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user