skia2/include/gpu/vk/GrVkDefines.h

168 lines
7.0 KiB
C
Raw Normal View History

/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef GrVkDefines_DEFINED
#define GrVkDefines_DEFINED
Revert "Revert "Plumb the use of GrBackendRenderTarget throughout Skia"" This reverts commit e3bd422fafc74dd3410c3de24a576635be92c3b4. Reason for revert: Pre-req changes have all landed in other projects at this point. Original change's description: > Revert "Plumb the use of GrBackendRenderTarget throughout Skia" > > This reverts commit fdd77daedbba3b7c53be74a82fb9fae891b51696. > > Reason for revert: Apparently I have a few more build files to update before this can land. > > Original change's description: > > Plumb the use of GrBackendRenderTarget throughout Skia > > > > Bug: skia: > > Change-Id: Ib99a58d9552f5c7b8d77c09dcc72fa88326c26aa > > Reviewed-on: https://skia-review.googlesource.com/14148 > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > Reviewed-by: Robert Phillips <robertphillips@google.com> > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > > > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reviews@skia.org > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > > Change-Id: I984e1909870182474c4c3cce257f01b6a9d8581f > Reviewed-on: https://skia-review.googlesource.com/14531 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reviews@skia.org # Not skipping CQ checks because original CL landed > 1 day ago. Change-Id: Ib7ab94aada8a7cb80fe38f24daf32f9208c5b169 Reviewed-on: https://skia-review.googlesource.com/14826 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-05-01 13:50:58 +00:00
#ifdef SK_VULKAN
#if defined(SK_BUILD_FOR_WIN) || defined(SK_BUILD_FOR_WIN32)
# if !defined(VK_USE_PLATFORM_WIN32_KHR)
# define VK_USE_PLATFORM_WIN32_KHR
# endif
#elif defined(SK_BUILD_FOR_ANDROID)
# if !defined(VK_USE_PLATFORM_ANDROID_KHR)
# define VK_USE_PLATFORM_ANDROID_KHR
# endif
#elif defined(SK_BUILD_FOR_UNIX)
# if defined(__Fuchsia__)
# if !defined(VK_USE_PLATFORM_MAGMA_KHR)
# define VK_USE_PLATFORM_MAGMA_KHR
# endif
# else
# if !defined(VK_USE_PLATFORM_XCB_KHR)
# define VK_USE_PLATFORM_XCB_KHR
# endif
# endif
#endif
#include <vulkan/vulkan.h>
#define SKIA_REQUIRED_VULKAN_HEADER_VERSION 17
#if VK_HEADER_VERSION < SKIA_REQUIRED_VULKAN_HEADER_VERSION
#error "Vulkan header version is too low"
#endif
#ifndef VK_KHR_get_physical_device_properties2
Revert "Revert "Update skia to use ifdefs for Vulkan code instead of dummy header"" This reverts commit fad9e3f54112ea8c8bb6bb72384f47b9759578f5. Reason for revert: Can't find the error message anymore (?!?) Let's try again shall we Original change's description: > Revert "Update skia to use ifdefs for Vulkan code instead of dummy header" > > This reverts commit c0f8e426c59eec6c720b8e1329dcb966cf1b6800. > > Reason for revert: Experiment to see if this will unblock the Android roll > > Original change's description: > > Update skia to use ifdefs for Vulkan code instead of dummy header > > > > Bug: skia:6721 > > Change-Id: I80a4c9f2acc09c174497f625c50ed12a8bb76505 > > Reviewed-on: https://skia-review.googlesource.com/19547 > > Reviewed-by: Mike Klein <mtklein@google.com> > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > TBR=egdaniel@google.com,mtklein@google.com,bsalomon@google.com > > Change-Id: Ib51c1672570f2071a17b6fbde692a5174b0358ce > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:6721 > Reviewed-on: https://skia-review.googlesource.com/19724 > Reviewed-by: Robert Phillips <robertphillips@google.com> > Commit-Queue: Robert Phillips <robertphillips@google.com> TBR=egdaniel@google.com,mtklein@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: Iecef7ddcfe31d82938336120a4193525ac6693be No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:6721 Reviewed-on: https://skia-review.googlesource.com/19782 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-14 01:43:29 +00:00
// Installed Vulkan SDK is too old to define VK_KHR_get_physical_device_properties2: define it here.
#define VK_KHR_get_physical_device_properties2 1
#define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION 1
#define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME "VK_KHR_get_physical_device_properties2"
typedef struct VkPhysicalDeviceFeatures2KHR {
VkStructureType sType;
void* pNext;
VkPhysicalDeviceFeatures features;
} VkPhysicalDeviceFeatures2KHR;
typedef struct VkPhysicalDeviceProperties2KHR {
VkStructureType sType;
void* pNext;
VkPhysicalDeviceProperties properties;
} VkPhysicalDeviceProperties2KHR;
typedef struct VkFormatProperties2KHR {
VkStructureType sType;
void* pNext;
VkFormatProperties formatProperties;
} VkFormatProperties2KHR;
typedef struct VkImageFormatProperties2KHR {
VkStructureType sType;
void* pNext;
VkImageFormatProperties imageFormatProperties;
} VkImageFormatProperties2KHR;
typedef struct VkPhysicalDeviceImageFormatInfo2KHR {
VkStructureType sType;
const void* pNext;
VkFormat format;
VkImageType type;
VkImageTiling tiling;
VkImageUsageFlags usage;
VkImageCreateFlags flags;
} VkPhysicalDeviceImageFormatInfo2KHR;
typedef struct VkQueueFamilyProperties2KHR {
VkStructureType sType;
void* pNext;
VkQueueFamilyProperties queueFamilyProperties;
} VkQueueFamilyProperties2KHR;
typedef struct VkPhysicalDeviceMemoryProperties2KHR {
VkStructureType sType;
void* pNext;
VkPhysicalDeviceMemoryProperties memoryProperties;
} VkPhysicalDeviceMemoryProperties2KHR;
typedef struct VkSparseImageFormatProperties2KHR {
VkStructureType sType;
void* pNext;
VkSparseImageFormatProperties properties;
} VkSparseImageFormatProperties2KHR;
typedef struct VkPhysicalDeviceSparseImageFormatInfo2KHR {
VkStructureType sType;
const void* pNext;
VkFormat format;
VkImageType type;
VkSampleCountFlagBits samples;
VkImageUsageFlags usage;
VkImageTiling tiling;
} VkPhysicalDeviceSparseImageFormatInfo2KHR;
typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFeatures2KHR)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2KHR* pFeatures);
typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceProperties2KHR)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2KHR* pProperties);
typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceFormatProperties2KHR)(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2KHR* pFormatProperties);
typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceImageFormatProperties2KHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo, VkImageFormatProperties2KHR* pImageFormatProperties);
typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceQueueFamilyProperties2KHR)(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2KHR* pQueueFamilyProperties);
typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceMemoryProperties2KHR)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties);
typedef void (VKAPI_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties2KHR)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2KHR* pProperties);
static constexpr VkStructureType VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR = (VkStructureType) 1000059001;
#endif // !VK_KHR_get_physical_device_properties2
#ifndef VK_EXT_discard_rectangles
// Installed Vulkan SDK is too old to define discard rectangles: define them here.
#define VK_EXT_discard_rectangles 1
#define VK_EXT_DISCARD_RECTANGLES_SPEC_VERSION 1
#define VK_EXT_DISCARD_RECTANGLES_EXTENSION_NAME "VK_EXT_discard_rectangles"
typedef enum VkDiscardRectangleModeEXT {
VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT = 0,
VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT = 1,
VK_DISCARD_RECTANGLE_MODE_BEGIN_RANGE_EXT = VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT,
VK_DISCARD_RECTANGLE_MODE_END_RANGE_EXT = VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT,
VK_DISCARD_RECTANGLE_MODE_RANGE_SIZE_EXT = (VK_DISCARD_RECTANGLE_MODE_EXCLUSIVE_EXT - VK_DISCARD_RECTANGLE_MODE_INCLUSIVE_EXT + 1),
VK_DISCARD_RECTANGLE_MODE_MAX_ENUM_EXT = 0x7FFFFFFF
} VkDiscardRectangleModeEXT;
typedef VkFlags VkPipelineDiscardRectangleStateCreateFlagsEXT;
typedef struct VkPhysicalDeviceDiscardRectanglePropertiesEXT {
VkStructureType sType;
const void* pNext;
uint32_t maxDiscardRectangles;
} VkPhysicalDeviceDiscardRectanglePropertiesEXT;
typedef struct VkPipelineDiscardRectangleStateCreateInfoEXT {
VkStructureType sType;
const void* pNext;
VkPipelineDiscardRectangleStateCreateFlagsEXT flags;
VkDiscardRectangleModeEXT discardRectangleMode;
uint32_t discardRectangleCount;
const VkRect2D* pDiscardRectangles;
} VkPipelineDiscardRectangleStateCreateInfoEXT;
typedef void (VKAPI_PTR *PFN_vkCmdSetDiscardRectangleEXT)(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D* pDiscardRectangles);
static constexpr VkStructureType VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT = (VkStructureType) 1000099000;
static constexpr VkStructureType VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT = (VkStructureType) 1000099001;
static constexpr VkDynamicState VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT = (VkDynamicState) 1000099000;
#endif // !VK_EXT_discard_rectangles
#endif // SK_VULKAN
#endif // GrVkDefines_DEFINED