Home | History | Annotate | Download | only in Vulkan
      1 // Copyright 2018 The SwiftShader Authors. All Rights Reserved.
      2 //
      3 // Licensed under the Apache License, Version 2.0 (the "License");
      4 // you may not use this file except in compliance with the License.
      5 // You may obtain a copy of the License at
      6 //
      7 //    http://www.apache.org/licenses/LICENSE-2.0
      8 //
      9 // Unless required by applicable law or agreed to in writing, software
     10 // distributed under the License is distributed on an "AS IS" BASIS,
     11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 // See the License for the specific language governing permissions and
     13 // limitations under the License.
     14 
     15 #ifndef VK_CONFIG_HPP_
     16 #define VK_CONFIG_HPP_
     17 
     18 #include "Version.h"
     19 
     20 #include <vulkan/vulkan_core.h>
     21 
     22 namespace vk
     23 {
     24 
     25 // Note: Constant array initialization requires a string literal.
     26 //       constexpr char* or char[] does not work for that purpose.
     27 #define SWIFTSHADER_DEVICE_NAME "SwiftShader Device" // Max length: VK_MAX_PHYSICAL_DEVICE_NAME_SIZE
     28 #define SWIFTSHADER_UUID "SwiftShaderUUID" // Max length: VK_UUID_SIZE (16)
     29 
     30 enum
     31 {
     32 	API_VERSION = VK_API_VERSION_1_1,
     33 	DRIVER_VERSION = VK_MAKE_VERSION(MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION),
     34 	VENDOR_ID = 0x1AE0, // Google
     35 	DEVICE_ID = 0xC0DE, // SwiftShader
     36 };
     37 
     38 enum
     39 {
     40 	REQUIRED_MEMORY_ALIGNMENT = 8, // For 64 bit formats on ARM64
     41 	MIN_TEXEL_BUFFER_OFFSET_ALIGNMENT = 256,
     42 	MIN_UNIFORM_BUFFER_OFFSET_ALIGNMENT = 256,
     43 	MIN_STORAGE_BUFFER_OFFSET_ALIGNMENT = 256,
     44 	MEMORY_TYPE_GENERIC_BIT = 0x1, // Generic system memory.
     45 };
     46 
     47 enum
     48 {
     49 	MAX_IMAGE_LEVELS_1D = 14,
     50 	MAX_IMAGE_LEVELS_2D = 14,
     51 	MAX_IMAGE_LEVELS_3D = 11,
     52 	MAX_IMAGE_LEVELS_CUBE = 14,
     53 	MAX_IMAGE_ARRAY_LAYERS = 11,
     54 };
     55 
     56 enum
     57 {
     58 	MAX_VERTEX_INPUT_BINDINGS = 16,
     59 };
     60 
     61 }
     62 
     63 #endif // VK_CONFIG_HPP_
     64