aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordan sinclair <dj2@everburning.com>2019-03-07 09:08:22 -0500
committerGitHub <noreply@github.com>2019-03-07 09:08:22 -0500
commit04349cb411a8e108e2d77318b8e5aafca675c964 (patch)
tree55438a973ef2a1a805c06b7fdc337462f17b6cea /src
parent1e92a1328f03fc05cbb24c6b46a8180009087158 (diff)
downloadamber-04349cb411a8e108e2d77318b8e5aafca675c964.tar.gz
[vulkan] fix shadow variable (#338)
Diffstat (limited to 'src')
-rw-r--r--src/vulkan/engine_vulkan.cc32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/vulkan/engine_vulkan.cc b/src/vulkan/engine_vulkan.cc
index fbf17d7..748bbbc 100644
--- a/src/vulkan/engine_vulkan.cc
+++ b/src/vulkan/engine_vulkan.cc
@@ -170,19 +170,21 @@ Result EngineVulkan::CreatePipeline(amber::Pipeline* pipeline) {
// Handle Image and Depth buffers early so they are available when we create
// the pipeline.
- for (const auto& info : pipeline->GetColorAttachments()) {
- Result r = SetBuffer(
- pipeline, info.type, static_cast<uint8_t>(info.location),
- info.buffer->AsFormatBuffer()->GetFormat(), info.buffer->GetData());
+ for (const auto& colour_info : pipeline->GetColorAttachments()) {
+ Result r = SetBuffer(pipeline, colour_info.type,
+ static_cast<uint8_t>(colour_info.location),
+ colour_info.buffer->AsFormatBuffer()->GetFormat(),
+ colour_info.buffer->GetData());
if (!r.IsSuccess())
return r;
}
if (pipeline->GetDepthBuffer().buffer) {
- const auto& info = pipeline->GetDepthBuffer();
- Result r = SetBuffer(
- pipeline, info.type, static_cast<uint8_t>(info.location),
- info.buffer->AsFormatBuffer()->GetFormat(), info.buffer->GetData());
+ const auto& depth_info = pipeline->GetDepthBuffer();
+ Result r = SetBuffer(pipeline, depth_info.type,
+ static_cast<uint8_t>(depth_info.location),
+ depth_info.buffer->AsFormatBuffer()->GetFormat(),
+ depth_info.buffer->GetData());
if (!r.IsSuccess())
return r;
}
@@ -222,13 +224,13 @@ Result EngineVulkan::CreatePipeline(amber::Pipeline* pipeline) {
info.vk_pipeline = std::move(vk_pipeline);
- for (const auto& info : pipeline->GetVertexBuffers()) {
- Result r =
- SetBuffer(pipeline, info.type, static_cast<uint8_t>(info.location),
- info.buffer->IsFormatBuffer()
- ? info.buffer->AsFormatBuffer()->GetFormat()
- : Format(),
- info.buffer->GetData());
+ for (const auto& vtex_info : pipeline->GetVertexBuffers()) {
+ Result r = SetBuffer(pipeline, vtex_info.type,
+ static_cast<uint8_t>(vtex_info.location),
+ vtex_info.buffer->IsFormatBuffer()
+ ? vtex_info.buffer->AsFormatBuffer()->GetFormat()
+ : Format(),
+ vtex_info.buffer->GetData());
if (!r.IsSuccess())
return r;
}