mirror of
https://github.com/libretro/RetroArch
synced 2025-04-07 13:23:32 +00:00
Fix slang_process string to C char regressions (#11943)
This commit is contained in:
parent
9a51de833d
commit
082ccc167e
@ -202,17 +202,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;
|
uniform_sem_t uniform = { map->uniforms[semantic],
|
||||||
const char *uniform_id = get_semantic_name(
|
src.num_components
|
||||||
sl_reflection, (slang_semantic)semantic, 0).c_str();
|
* (unsigned)sizeof(float) };
|
||||||
|
string uniform_id = get_semantic_name(
|
||||||
|
sl_reflection, (slang_semantic)semantic, 0);
|
||||||
|
|
||||||
uniform.data = map->uniforms[semantic];
|
strlcpy(uniform.id, uniform_id.c_str(), sizeof(uniform.id));
|
||||||
uniform.size = src.num_components * (unsigned)sizeof(float);
|
|
||||||
uniform.offset = 0;
|
|
||||||
uniform.id[0] = '\0';
|
|
||||||
|
|
||||||
if (!string_is_empty(uniform_id))
|
|
||||||
strlcpy(uniform.id, uniform_id, sizeof(uniform.id));
|
|
||||||
|
|
||||||
if (src.push_constant)
|
if (src.push_constant)
|
||||||
{
|
{
|
||||||
@ -233,16 +229,12 @@ static bool slang_process_reflection(
|
|||||||
|
|
||||||
if (src.push_constant || src.uniform)
|
if (src.push_constant || src.uniform)
|
||||||
{
|
{
|
||||||
uniform_sem_t uniform;
|
uniform_sem_t uniform = {
|
||||||
const char *uniform_id = get_semantic_name(
|
&shader_info->parameters[i].current, sizeof(float) };
|
||||||
sl_reflection, SLANG_SEMANTIC_FLOAT_PARAMETER, i).c_str();
|
|
||||||
|
|
||||||
uniform.data = &shader_info->parameters[i].current;
|
string uniform_id = get_semantic_name(
|
||||||
uniform.size = sizeof(float);
|
sl_reflection, SLANG_SEMANTIC_FLOAT_PARAMETER, i);
|
||||||
uniform.offset = 0;
|
strlcpy(uniform.id, uniform_id.c_str(), sizeof(uniform.id));
|
||||||
uniform.id[0] = '\0';
|
|
||||||
|
|
||||||
strlcpy(uniform.id, uniform_id, sizeof(uniform.id));
|
|
||||||
|
|
||||||
if (src.push_constant)
|
if (src.push_constant)
|
||||||
{
|
{
|
||||||
@ -303,20 +295,18 @@ static bool slang_process_reflection(
|
|||||||
|
|
||||||
if (src.push_constant || src.uniform)
|
if (src.push_constant || src.uniform)
|
||||||
{
|
{
|
||||||
uniform_sem_t uniform;
|
uniform_sem_t uniform = {
|
||||||
const char *uniform_id =
|
(void*)((uintptr_t)map->textures[semantic].size
|
||||||
get_size_semantic_name(
|
+ index * map->textures[semantic].size_stride),
|
||||||
sl_reflection,
|
4 * sizeof(float)
|
||||||
(slang_texture_semantic)semantic, index).c_str();
|
};
|
||||||
|
|
||||||
uniform.data = (void*)((uintptr_t)
|
string uniform_id =
|
||||||
map->textures[semantic].size
|
get_size_semantic_name(
|
||||||
+ index * map->textures[semantic].size_stride);
|
sl_reflection,
|
||||||
uniform.size = 4 * sizeof(float);
|
(slang_texture_semantic)semantic, index);
|
||||||
uniform.offset = 0;
|
|
||||||
uniform.id[0] = '\0';
|
|
||||||
|
|
||||||
strlcpy(uniform.id, uniform_id, sizeof(uniform.id));
|
strlcpy(uniform.id, uniform_id.c_str(), sizeof(uniform.id));
|
||||||
|
|
||||||
if (src.push_constant)
|
if (src.push_constant)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user