void GrVkCaps::init(const GrContextOptions& contextOptions, const GrVkInterface* vkInterface, VkPhysicalDevice physDev, uint32_t featureFlags, uint32_t extensionFlags) { VkPhysicalDeviceProperties properties; GR_VK_CALL(vkInterface, GetPhysicalDeviceProperties(physDev, &properties)); VkPhysicalDeviceMemoryProperties memoryProperties; GR_VK_CALL(vkInterface, GetPhysicalDeviceMemoryProperties(physDev, &memoryProperties)); this->initGrCaps(properties, memoryProperties, featureFlags); this->initGLSLCaps(properties, featureFlags); this->initConfigTable(vkInterface, physDev); this->initStencilFormat(vkInterface, physDev); if (SkToBool(extensionFlags & kNV_glsl_shader_GrVkExtensionFlag)) { // Currently disabling this feature since it does not play well with validation layers which // expect a SPIR-V shader // fCanUseGLSLForShaderModule = true; } if (kQualcomm_VkVendor == properties.vendorID) { fMustDoCopiesFromOrigin = true; fAllowInitializationErrorOnTearDown = true; } if (kNvidia_VkVendor == properties.vendorID) { fSupportsCopiesAsDraws = true; fMustSubmitCommandsBeforeCopyOp = true; } this->applyOptionsOverrides(contextOptions); GrGLSLCaps* glslCaps = static_cast<GrGLSLCaps*>(fShaderCaps.get()); glslCaps->applyOptionsOverrides(contextOptions); }
void GrVkCaps::init(const GrContextOptions& contextOptions, const GrVkInterface* vkInterface, VkPhysicalDevice physDev, uint32_t featureFlags, uint32_t extensionFlags) { VkPhysicalDeviceProperties properties; GR_VK_CALL(vkInterface, GetPhysicalDeviceProperties(physDev, &properties)); VkPhysicalDeviceMemoryProperties memoryProperties; GR_VK_CALL(vkInterface, GetPhysicalDeviceMemoryProperties(physDev, &memoryProperties)); this->initGrCaps(properties, memoryProperties, featureFlags); this->initShaderCaps(properties, featureFlags); this->initConfigTable(vkInterface, physDev); this->initStencilFormat(vkInterface, physDev); if (SkToBool(extensionFlags & kNV_glsl_shader_GrVkExtensionFlag)) { // Currently disabling this feature since it does not play well with validation layers which // expect a SPIR-V shader // fCanUseGLSLForShaderModule = true; } if (kQualcomm_VkVendor == properties.vendorID) { fMustDoCopiesFromOrigin = true; } if (kNvidia_VkVendor == properties.vendorID) { fMustSubmitCommandsBeforeCopyOp = true; } if (kQualcomm_VkVendor != properties.vendorID) { fSupportsCopiesAsDraws = true; } if (fSupportsCopiesAsDraws) { fCrossContextTextureSupport = true; } #if defined(SK_BUILD_FOR_WIN) if (kNvidia_VkVendor == properties.vendorID) { fMustSleepOnTearDown = true; } #elif defined(SK_BUILD_FOR_ANDROID) if (kImagination_VkVendor == properties.vendorID) { fMustSleepOnTearDown = true; } #endif this->applyOptionsOverrides(contextOptions); fShaderCaps->applyOptionsOverrides(contextOptions); }
void GrVkCaps::init(const GrContextOptions& contextOptions, const GrVkInterface* vkInterface, VkPhysicalDevice physDev, uint32_t featureFlags, uint32_t extensionFlags) { VkPhysicalDeviceProperties properties; GR_VK_CALL(vkInterface, GetPhysicalDeviceProperties(physDev, &properties)); VkPhysicalDeviceMemoryProperties memoryProperties; GR_VK_CALL(vkInterface, GetPhysicalDeviceMemoryProperties(physDev, &memoryProperties)); this->initGrCaps(properties, memoryProperties, featureFlags); this->initGLSLCaps(properties, featureFlags); this->initConfigTable(vkInterface, physDev); this->initStencilFormat(vkInterface, physDev); if (SkToBool(extensionFlags & kNV_glsl_shader_GrVkExtensionFlag)) { // Currently disabling this feature since it does not play well with validation layers which // expect a SPIR-V shader // fCanUseGLSLForShaderModule = true; } this->applyOptionsOverrides(contextOptions); GrGLSLCaps* glslCaps = static_cast<GrGLSLCaps*>(fShaderCaps.get()); glslCaps->applyOptionsOverrides(contextOptions); }