Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Platform.h #375

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions Engine/Shader/Platform.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
#ifndef __PLATFORM_H__
#define __PLATFORM_H__
#pragma once

#if VULKAN
#define VkBinding(x, y) [[vk::binding(x, y)]]
#define VkLocation(x) [[vk::location(x)]]
#ifndef PLATFORM_H
#define PLATFORM_H

/// \file Platform.hpp
/// \brief Macros to handle Vulkan-specific attributes in shader code.

/// If VULKAN is defined, these macros expand to Vulkan binding/attribute specifiers.
/// Otherwise, they expand to nothing.

// If building with Vulkan, define the macros with valid attributes
#if defined(VULKAN)
#define VK_BINDING(set_index, binding_index) [[vk::binding(set_index, binding_index)]]
#define VK_LOCATION(location_index) [[vk::location(location_index)]]
#else
#define VkBinding(x, y)
#define VkLocation(x)
#define VK_BINDING(set_index, binding_index)
#define VK_LOCATION(location_index)
#endif

#endif
#endif // PLATFORM_H