mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
Merge pull request #6213 from aliaspider/master
(d3d11) slang reflection fix.
This commit is contained in:
commit
7eecb5b2b8
@ -165,6 +165,9 @@ static bool slang_process_reflection(
|
||||
while (uniform_map->data)
|
||||
{
|
||||
slang_semantic_meta& src = sl_reflection.semantics[uniform_map->semantic];
|
||||
|
||||
if (src.push_constant || src.uniform)
|
||||
{
|
||||
uniform_sem_t uniform = { uniform_map->data, uniform_map->id,
|
||||
src.num_components * (unsigned)sizeof(float) };
|
||||
|
||||
@ -176,18 +179,22 @@ static bool slang_process_reflection(
|
||||
uniform.offset = src.push_constant_offset;
|
||||
uniforms[SLANG_CBUFFER_PC].push_back(uniform);
|
||||
}
|
||||
else if (src.uniform)
|
||||
else
|
||||
{
|
||||
uniform.offset = src.ubo_offset;
|
||||
uniforms[SLANG_CBUFFER_UBO].push_back(uniform);
|
||||
}
|
||||
}
|
||||
|
||||
uniform_map++;
|
||||
}
|
||||
|
||||
/* TODO: this is emitting more uniforms than actally needed for this pass */
|
||||
for (int i = 0; i < sl_reflection.semantic_float_parameters.size(); i++)
|
||||
{
|
||||
slang_semantic_meta& src = sl_reflection.semantic_float_parameters[i];
|
||||
|
||||
if (src.push_constant || src.uniform)
|
||||
{
|
||||
uniform_sem_t uniform = { &shader_info->parameters[i].current,
|
||||
"shader_info->parameter[i].current", sizeof(float) };
|
||||
|
||||
@ -199,12 +206,13 @@ static bool slang_process_reflection(
|
||||
uniform.offset = src.push_constant_offset;
|
||||
uniforms[SLANG_CBUFFER_PC].push_back(uniform);
|
||||
}
|
||||
else if (src.uniform)
|
||||
else
|
||||
{
|
||||
uniform.offset = src.ubo_offset;
|
||||
uniforms[SLANG_CBUFFER_UBO].push_back(uniform);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
texture_map_t* texture_map = semantics_map->texture_map;
|
||||
|
||||
@ -226,7 +234,10 @@ static bool slang_process_reflection(
|
||||
strncpy(texture.id, id.c_str(), sizeof(texture.id));
|
||||
|
||||
textures.push_back(texture);
|
||||
}
|
||||
|
||||
if (src.push_constant || src.uniform)
|
||||
{
|
||||
uniform_sem_t uniform = { texture_map->size_data, texture_map->size_id,
|
||||
4 * sizeof(float) };
|
||||
|
||||
@ -240,13 +251,14 @@ static bool slang_process_reflection(
|
||||
uniform.offset = src.push_constant_offset;
|
||||
uniforms[SLANG_CBUFFER_PC].push_back(uniform);
|
||||
}
|
||||
else if (src.uniform)
|
||||
else
|
||||
{
|
||||
uniform.offset = src.ubo_offset;
|
||||
uniforms[SLANG_CBUFFER_UBO].push_back(uniform);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
texture_map++;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user