Skip to content

Commit

Permalink
Support compiling with older SDK headers
Browse files Browse the repository at this point in the history
  • Loading branch information
kd-11 committed Dec 10, 2022
1 parent e4ac6be commit bf1f933
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
23 changes: 22 additions & 1 deletion rpcs3/Emu/RSX/VK/VulkanAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <util/types.hpp>

#if VK_HEADER_VERSION < 224
#ifndef VK_EXT_attachment_feedback_loop_layout

#define VK_EXT_attachment_feedback_loop_layout 1
#define VK_EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_EXTENSION_NAME "VK_EXT_attachment_feedback_loop_layout"
Expand All @@ -37,3 +37,24 @@ typedef struct VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT {
} VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT;

#endif

#ifndef VK_KHR_fragment_shader_barycentric

#define VK_KHR_fragment_shader_barycentric 1
#define VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_SPEC_VERSION 1
#define VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME "VK_KHR_fragment_shader_barycentric"
#define VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR static_cast<VKStructureType>(1000203000)

typedef struct VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR {
VkStructureType sType;
void* pNext;
VkBool32 fragmentShaderBarycentric;
} VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR;

typedef struct VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR {
VkStructureType sType;
void* pNext;
VkBool32 triStripVertexOrderIndependentOfProvokingVertex;
} VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR;

#endif
5 changes: 5 additions & 0 deletions rpcs3/Emu/RSX/VK/vkutils/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,11 @@ namespace vk
requested_extensions.push_back(VK_EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_EXTENSION_NAME);
}

if (pgpu->barycoords_support)
{
requested_extensions.push_back(VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME);
}

enabled_features.robustBufferAccess = VK_TRUE;
enabled_features.fullDrawIndexUint32 = VK_TRUE;
enabled_features.independentBlend = VK_TRUE;
Expand Down

0 comments on commit bf1f933

Please sign in to comment.