mirror of
https://github.com/libretro/RetroArch
synced 2025-04-07 13:23:32 +00:00
(shader_slang.cpp) Simplify usage of functions that are only
ever used as C-strings
This commit is contained in:
parent
ca83be1db4
commit
d89fb0e7c4
@ -211,13 +211,13 @@ static bool slang_process_reflection(
|
|||||||
slang_semantic_meta& src = sl_reflection.semantics[semantic];
|
slang_semantic_meta& src = sl_reflection.semantics[semantic];
|
||||||
if (src.push_constant || src.uniform)
|
if (src.push_constant || src.uniform)
|
||||||
{
|
{
|
||||||
uniform_sem_t uniform = { map->uniforms[semantic],
|
uniform_sem_t uniform = { map->uniforms[semantic],
|
||||||
src.num_components
|
src.num_components
|
||||||
* (unsigned)sizeof(float) };
|
* (unsigned)sizeof(float) };
|
||||||
string uniform_id = get_semantic_name(
|
const char *uniform_id = get_semantic_name(
|
||||||
sl_reflection, (slang_semantic)semantic, 0);
|
sl_reflection, (slang_semantic)semantic, 0).c_str();
|
||||||
|
|
||||||
strlcpy(uniform.id, uniform_id.c_str(), sizeof(uniform.id));
|
strlcpy(uniform.id, uniform_id, sizeof(uniform.id));
|
||||||
|
|
||||||
if (src.push_constant)
|
if (src.push_constant)
|
||||||
{
|
{
|
||||||
@ -241,9 +241,9 @@ static bool slang_process_reflection(
|
|||||||
uniform_sem_t uniform = {
|
uniform_sem_t uniform = {
|
||||||
&shader_info->parameters[i].current, sizeof(float) };
|
&shader_info->parameters[i].current, sizeof(float) };
|
||||||
|
|
||||||
string uniform_id = get_semantic_name(
|
const char *uniform_id = get_semantic_name(
|
||||||
sl_reflection, SLANG_SEMANTIC_FLOAT_PARAMETER, i);
|
sl_reflection, SLANG_SEMANTIC_FLOAT_PARAMETER, i).c_str();
|
||||||
strlcpy(uniform.id, uniform_id.c_str(), sizeof(uniform.id));
|
strlcpy(uniform.id, uniform_id, sizeof(uniform.id));
|
||||||
|
|
||||||
if (src.push_constant)
|
if (src.push_constant)
|
||||||
{
|
{
|
||||||
@ -309,12 +309,12 @@ static bool slang_process_reflection(
|
|||||||
4 * sizeof(float)
|
4 * sizeof(float)
|
||||||
};
|
};
|
||||||
|
|
||||||
string uniform_id =
|
const char *uniform_id =
|
||||||
get_size_semantic_name(
|
get_size_semantic_name(
|
||||||
sl_reflection,
|
sl_reflection,
|
||||||
(slang_texture_semantic)semantic, index);
|
(slang_texture_semantic)semantic, index).c_str();
|
||||||
|
|
||||||
strlcpy(uniform.id, uniform_id.c_str(), sizeof(uniform.id));
|
strlcpy(uniform.id, uniform_id, sizeof(uniform.id));
|
||||||
|
|
||||||
if (src.push_constant)
|
if (src.push_constant)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user