mirror of
https://github.com/libretro/RetroArch
synced 2025-02-01 09:32:58 +00:00
(shader_vulkan.cpp) Nits
This commit is contained in:
parent
1055938b67
commit
6002fd9f2a
@ -1218,7 +1218,6 @@ void *Buffer::map()
|
||||
{
|
||||
if (vkMapMemory(device, memory, 0, size, 0, &mapped) == VK_SUCCESS)
|
||||
return mapped;
|
||||
else
|
||||
return nullptr;
|
||||
}
|
||||
return mapped;
|
||||
@ -1739,6 +1738,10 @@ bool Pass::init_feedback()
|
||||
|
||||
bool Pass::build()
|
||||
{
|
||||
unordered_map<string, slang_semantic_map> semantic_map;
|
||||
unsigned i;
|
||||
unsigned j = 0;
|
||||
|
||||
framebuffer.reset();
|
||||
framebuffer_feedback.reset();
|
||||
|
||||
@ -1750,8 +1753,6 @@ bool Pass::build()
|
||||
pass_info.rt_format, pass_info.max_levels));
|
||||
}
|
||||
|
||||
unordered_map<string, slang_semantic_map> semantic_map;
|
||||
unsigned j = 0;
|
||||
for (auto ¶m : parameters)
|
||||
{
|
||||
if (!set_unique_map(semantic_map, param.id,
|
||||
@ -1771,14 +1772,13 @@ bool Pass::build()
|
||||
|
||||
// Filter out parameters which we will never use anyways.
|
||||
filtered_parameters.clear();
|
||||
for (unsigned i = 0; i < reflection.semantic_float_parameters.size(); i++)
|
||||
|
||||
for (i = 0; i < reflection.semantic_float_parameters.size(); i++)
|
||||
{
|
||||
if (reflection.semantic_float_parameters[i].uniform ||
|
||||
reflection.semantic_float_parameters[i].push_constant)
|
||||
{
|
||||
filtered_parameters.push_back(parameters[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!init_pipeline())
|
||||
return false;
|
||||
@ -1837,10 +1837,8 @@ void Pass::set_semantic_texture_array(VkDescriptorSet set,
|
||||
{
|
||||
if (index < reflection.semantic_textures[semantic].size() &&
|
||||
reflection.semantic_textures[semantic][index].texture)
|
||||
{
|
||||
set_texture(set, reflection.semantic_textures[semantic][index].binding, texture);
|
||||
}
|
||||
}
|
||||
|
||||
void Pass::build_semantic_texture_array_vec4(uint8_t *data, slang_texture_semantic semantic,
|
||||
unsigned index, unsigned width, unsigned height)
|
||||
@ -1850,21 +1848,17 @@ void Pass::build_semantic_texture_array_vec4(uint8_t *data, slang_texture_semant
|
||||
return;
|
||||
|
||||
if (data && refl[index].uniform)
|
||||
{
|
||||
build_vec4(
|
||||
reinterpret_cast<float *>(data + refl[index].ubo_offset),
|
||||
width,
|
||||
height);
|
||||
}
|
||||
|
||||
if (refl[index].push_constant)
|
||||
{
|
||||
build_vec4(
|
||||
reinterpret_cast<float *>(push.buffer.data() + (refl[index].push_constant_offset >> 2)),
|
||||
width,
|
||||
height);
|
||||
}
|
||||
}
|
||||
|
||||
void Pass::build_semantic_texture_vec4(uint8_t *data, slang_texture_semantic semantic,
|
||||
unsigned width, unsigned height)
|
||||
@ -1876,22 +1870,19 @@ void Pass::build_semantic_vec4(uint8_t *data, slang_semantic semantic,
|
||||
unsigned width, unsigned height)
|
||||
{
|
||||
auto &refl = reflection.semantics[semantic];
|
||||
|
||||
if (data && refl.uniform)
|
||||
{
|
||||
build_vec4(
|
||||
reinterpret_cast<float *>(data + refl.ubo_offset),
|
||||
width,
|
||||
height);
|
||||
}
|
||||
|
||||
if (refl.push_constant)
|
||||
{
|
||||
build_vec4(
|
||||
reinterpret_cast<float *>(push.buffer.data() + (refl.push_constant_offset >> 2)),
|
||||
width,
|
||||
height);
|
||||
}
|
||||
}
|
||||
|
||||
void Pass::build_semantic_parameter(uint8_t *data, unsigned index, float value)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user