Lines Matching +full:- +full:- +full:devsim
2 * Copyright (c) 2015-2019 The Khronos Group Inc.
3 * Copyright (c) 2015-2019 Valve Corporation
4 * Copyright (c) 2015-2019 LunarG, Inc.
5 * Copyright (c) 2015-2019 Google, Inc.
11 * http://www.apache.org/licenses/LICENSE-2.0
94 // Enable device profile as last layer on stack overriding devsim if there, or return if not availa…
183 // WARNING: The DevSim layer can override the properties that are tested here, making the result of
184 // this function dubious when DevSim is active.
193 // Some tests may need to be skipped if the devsim layer is in use.
211 " vertices[0] = vec2(-10.0, -10.0);\n" in DeviceCanDraw()
212 " vertices[1] = vec2( 10.0, -10.0);\n" in DeviceCanDraw()
228 pipe->AddShader(vs); in DeviceCanDraw()
229 pipe->AddShader(fs); in DeviceCanDraw()
230 pipe->AddDefaultColorAttachment(); in DeviceCanDraw()
233 descriptorSet->CreateVKDescriptorSet(m_commandBuffer); in DeviceCanDraw()
235 pipe->CreateVKPipeline(descriptorSet->GetPipelineLayout(), renderPass()); in DeviceCanDraw()
237 m_commandBuffer->begin(); in DeviceCanDraw()
238 m_commandBuffer->BeginRenderPass(m_renderPassBeginInfo); in DeviceCanDraw()
240 vkCmdBindPipeline(m_commandBuffer->handle(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipe->handle()); in DeviceCanDraw()
241 m_commandBuffer->BindDescriptorSet(*descriptorSet); in DeviceCanDraw()
246 vkCmdSetViewport(m_commandBuffer->handle(), 0, 1, &viewport); in DeviceCanDraw()
247 vkCmdSetScissor(m_commandBuffer->handle(), 0, 1, &scissors); in DeviceCanDraw()
249 vkCmdDraw(m_commandBuffer->handle(), 3, 1, 0, 0); in DeviceCanDraw()
251 m_commandBuffer->EndRenderPass(); in DeviceCanDraw()
252 m_commandBuffer->end(); in DeviceCanDraw()
257 submit_info.pCommandBuffers = &m_commandBuffer->handle(); in DeviceCanDraw()
259 vkQueueSubmit(m_device->m_queue, 1, &submit_info, VK_NULL_HANDLE); in DeviceCanDraw()
260 vkQueueWaitIdle(m_device->m_queue); in DeviceCanDraw()
262 auto pixels = m_renderTargets[0]->Read(); in DeviceCanDraw()
273 // Only enable device profile layer by default if devsim is not enabled in InitFramework()
326 err = vkCreateInstance(&instInfo, NULL, &this->inst); in InitFramework()
329 err = vkEnumeratePhysicalDevices(inst, &this->gpu_count, NULL); in InitFramework()
330 ASSERT_LE(this->gpu_count, ARRAY_SIZE(objs)) << "Too many gpus"; in InitFramework()
332 err = vkEnumeratePhysicalDevices(inst, &this->gpu_count, objs); in InitFramework()
334 ASSERT_GE(this->gpu_count, (uint32_t)1) << "No GPU available"; in InitFramework()
337 …(PFN_vkCreateDebugReportCallbackEXT)vkGetInstanceProcAddr(this->inst, "vkCreateDebugReportCallback… in InitFramework()
342 … err = m_CreateDebugReportCallback(this->inst, &dbgCreateInfo, NULL, &m_globalMsgCallback); in InitFramework()
346 …(PFN_vkDestroyDebugReportCallbackEXT)vkGetInstanceProcAddr(this->inst, "vkDestroyDebugReportCallba… in InitFramework()
349 …m_DebugReportMessage = (PFN_vkDebugReportMessageEXT)vkGetInstanceProcAddr(this->inst, "vkDebugRepo… in InitFramework()
358 if (!this->inst) return; in ShutdownFramework()
369 if (m_globalMsgCallback) m_DestroyDebugReportCallback(this->inst, m_globalMsgCallback, NULL); in ShutdownFramework()
371 if (m_devMsgCallback) m_DestroyDebugReportCallback(this->inst, m_devMsgCallback, NULL); in ShutdownFramework()
383 if (this->inst) vkDestroyInstance(this->inst, NULL); in ShutdownFramework()
384 this->inst = (VkInstance)0; // In case we want to re-initialize in ShutdownFramework()
390 *features = temp_device->phy().features(); in GetPhysicalDeviceFeatures()
393 *features = m_device->phy().features(); in GetPhysicalDeviceFeatures()
425 m_device->SetDeviceQueue(); in InitState()
449 m_commandPool = new VkCommandPoolObj(m_device, m_device->graphics_queue_node_index_, flags); in InitState()
555 for (size_t i = 0; i < m_device->queue_props.size(); ++i) { in InitSwapchain()
557 vkGetPhysicalDeviceSurfaceSupportKHR(m_device->phy().handle(), i, surface, &presentSupport); in InitSwapchain()
561 vkGetPhysicalDeviceSurfaceCapabilitiesKHR(m_device->phy().handle(), surface, &capabilities); in InitSwapchain()
564 vkGetPhysicalDeviceSurfaceFormatsKHR(m_device->phy().handle(), surface, &format_count, nullptr); in InitSwapchain()
568 …vkGetPhysicalDeviceSurfaceFormatsKHR(m_device->phy().handle(), surface, &format_count, formats.dat… in InitSwapchain()
572 …vkGetPhysicalDeviceSurfacePresentModesKHR(m_device->phy().handle(), surface, &present_mode_count, … in InitSwapchain()
576 …vkGetPhysicalDeviceSurfacePresentModesKHR(m_device->phy().handle(), surface, &present_mode_count, … in InitSwapchain()
666 vkGetPhysicalDeviceFormatProperties(m_device->phy().handle(), m_render_target_fmt, &props); in InitRenderTarget()
669 img->Init((uint32_t)m_width, (uint32_t)m_height, 1, m_render_target_fmt, in InitRenderTarget()
673 img->Init((uint32_t)m_width, (uint32_t)m_height, 1, m_render_target_fmt, in InitRenderTarget()
680 bindings.push_back(img->targetView(m_render_target_fmt)); in InitRenderTarget()
729 // Add a subpass self-dependency to subpass 0 of default renderPass in InitRenderTarget()
732 // Just using all framebuffer-space pipeline stages in order to get a reasonably large in InitRenderTarget()
738 // Add all of the gfx mem access bits that correlate to the fb-space pipeline stages in InitRenderTarget()
747 // Must include dep_by_region bit when src & dst both include framebuffer-space stages in InitRenderTarget()
814 m_queue = graphics_queues()[0]->handle(); in SetDeviceQueue()
892 VkDescriptorImageInfo tmp = texture->DescriptorImageInfo(); in AppendSamplerTexture()
893 tmp.sampler = sampler->handle(); in AppendSamplerTexture()
906 return m_set->handle(); in GetDescriptorSetHandle()
917 poolSize.descriptorCount = it->second; in CreateVKDescriptorSet()
918 poolSize.type = it->first; in CreateVKDescriptorSet()
954 it->dstSet = m_set->handle(); in CreateVKDescriptorSet()
955 if (it->descriptorType == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER) in CreateVKDescriptorSet()
956 it->pImageInfo = &m_imageSamplerDescriptors[imageSamplerCount++]; in CreateVKDescriptorSet()
960 m_device->update_descriptor_sets(m_writes); in CreateVKDescriptorSet()
987 device = dev->device(); in VkRenderpassObj()
999 // clang-format off
1019 // clang-format on in ImageMemoryBarrier()
1030 …vkCmdPipelineBarrier(cmd_buf->handle(), src_stages, dest_stages, VK_DEPENDENCY_BY_REGION_BIT, 0, N… in ImageMemoryBarrier()
1104 VkCommandPoolObj pool(m_device, m_device->graphics_queue_node_index_); in SetLayout()
1123 if (m_device->IsEnabledExtension(VK_IMG_FILTER_CUBIC_EXTENSION_NAME)) { in IsCompatible()
1127 if (m_device->IsEnabledExtension(VK_KHR_MAINTENANCE1_EXTENSION_NAME)) { in IsCompatible()
1131 if (m_device->IsEnabledExtension(VK_EXT_SAMPLER_FILTER_MINMAX_EXTENSION_NAME)) { in IsCompatible()
1135 if (m_device->IsEnabledExtension(VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME)) { in IsCompatible()
1152 if (m_device->IsEnabledExtension(VK_KHR_MAINTENANCE1_EXTENSION_NAME)) { in IsCompatible()
1153 // WORKAROUND: for DevSim not reporting extended enums, and possibly some drivers too in IsCompatible()
1172 vkGetPhysicalDeviceFormatProperties(m_device->phy().handle(), format, &image_fmt); in InitNoLayout()
1202 if (queue_families && (queue_families->size() > 1)) { in InitNoLayout()
1204 imageCreateInfo.queueFamilyIndexCount = static_cast<uint32_t>(queue_families->size()); in InitNoLayout()
1205 imageCreateInfo.pQueueFamilyIndices = queue_families->data(); in InitNoLayout()
1246 vkGetPhysicalDeviceFormatProperties(m_device->phy().handle(), create_info->format, &image_fmt); in init()
1248 switch (create_info->tiling) { in init()
1250 if (!IsCompatible(create_info->usage, image_fmt.optimalTilingFeatures)) { in init()
1252 … << create_info->usage << ", supported optimal features: " << image_fmt.optimalTilingFeatures; in init()
1256 if (!IsCompatible(create_info->usage, image_fmt.linearTilingFeatures)) { in init()
1258 … << create_info->usage << ", supported linear features: " << image_fmt.linearTilingFeatures; in init()
1264 Layout(create_info->initialLayout); in init()
1269 if (FormatIsDepthAndStencil(create_info->format)) { in init()
1271 } else if (FormatIsDepthOnly(create_info->format)) { in init()
1273 } else if (FormatIsStencilOnly(create_info->format)) { in init()
1284 VkCommandPoolObj pool(m_device, m_device->graphics_queue_node_index_); in CopyImage()
1294 …dest_image_layout = (this->Layout() == VK_IMAGE_LAYOUT_UNDEFINED) ? VK_IMAGE_LAYOUT_GENERAL : this… in CopyImage()
1295 this->SetLayout(&cmd_buf, VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL); in CopyImage()
1318 this->SetLayout(&cmd_buf, VK_IMAGE_ASPECT_COLOR_BIT, dest_image_layout); in CopyImage()
1331 VkCommandPoolObj pool(m_device, m_device->graphics_queue_node_index_); in CopyImageOut()
1336 src_image_layout = this->Layout(); in CopyImageOut()
1337 this->SetLayout(&cmd_buf, VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL); in CopyImageOut()
1361 this->SetLayout(&cmd_buf, VK_IMAGE_ASPECT_COLOR_BIT, src_image_layout); in CopyImageOut()
1507 this->m_descriptorBufferInfo.buffer = handle(); in VkConstantBufferObj()
1508 this->m_descriptorBufferInfo.offset = 0; in VkConstantBufferObj()
1509 this->m_descriptorBufferInfo.range = allocationSize; in VkConstantBufferObj()
1532 framework->GLSLtoSPV(stage, shader_code, spv, debug); in VkShaderObj()
1560 framework->ASMtoSPV(SPV_ENV_VULKAN_1_0, 0, spv_source.data(), spv); in VkShaderObj()
1655 void VkPipelineObj::AddShader(VkShaderObj *shader) { m_shaderStages.push_back(shader->GetStageCreat… in AddShader()
1718 gp_ci->stageCount = m_shaderStages.size(); in InitGraphicsPipelineCreateInfo()
1719 gp_ci->pStages = m_shaderStages.size() ? m_shaderStages.data() : nullptr; in InitGraphicsPipelineCreateInfo()
1722 gp_ci->pVertexInputState = &m_vi_state; in InitGraphicsPipelineCreateInfo()
1725 gp_ci->pInputAssemblyState = &m_ia_state; in InitGraphicsPipelineCreateInfo()
1727 gp_ci->sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO; in InitGraphicsPipelineCreateInfo()
1728 gp_ci->pNext = NULL; in InitGraphicsPipelineCreateInfo()
1729 gp_ci->flags = 0; in InitGraphicsPipelineCreateInfo()
1753 gp_ci->pDynamicState = &m_pd_state; in InitGraphicsPipelineCreateInfo()
1756 gp_ci->subpass = 0; in InitGraphicsPipelineCreateInfo()
1757 gp_ci->pViewportState = &m_vp_state; in InitGraphicsPipelineCreateInfo()
1758 gp_ci->pRasterizationState = &m_rs_state; in InitGraphicsPipelineCreateInfo()
1759 gp_ci->pMultisampleState = &m_ms_state; in InitGraphicsPipelineCreateInfo()
1760 gp_ci->pDepthStencilState = m_ds_state; in InitGraphicsPipelineCreateInfo()
1761 gp_ci->pColorBlendState = &m_cb_state; in InitGraphicsPipelineCreateInfo()
1762 gp_ci->pTessellationState = m_te_state; in InitGraphicsPipelineCreateInfo()
1774 gp_ci->layout = layout; in CreateVKPipeline()
1775 gp_ci->renderPass = render_pass; in CreateVKPipeline()
1785 m_queue = m_device->GetDefaultQueue(); in VkCommandBufferObj()
1789 auto create_info = vk_testing::CommandBuffer::create_info(pool->handle()); in VkCommandBufferObj()
1820 color_obj->Layout(VK_IMAGE_LAYOUT_UNDEFINED); in ClearAllBuffers()
1821 color_obj->SetLayout(this, subrange.aspectMask, clear_layout); in ClearAllBuffers()
1822 ClearColorImage(color_obj->image(), clear_layout, &clear_color, 1, &subrange); in ClearAllBuffers()
1825 if (depth_stencil_obj && depth_stencil_obj->Initialized()) { in ClearAllBuffers()
1827 …if (FormatIsDepthOnly(depth_stencil_obj->format())) subrange.aspectMask = VK_IMAGE_ASPECT_DEPTH_BI… in ClearAllBuffers()
1828 …if (FormatIsStencilOnly(depth_stencil_obj->format())) subrange.aspectMask = VK_IMAGE_ASPECT_STENCI… in ClearAllBuffers()
1830 depth_stencil_obj->Layout(VK_IMAGE_LAYOUT_UNDEFINED); in ClearAllBuffers()
1831 depth_stencil_obj->SetLayout(this, subrange.aspectMask, clear_layout); in ClearAllBuffers()
1834 … ClearDepthStencilImage(depth_stencil_obj->handle(), clear_layout, &clear_value, 1, &subrange); in ClearAllBuffers()
1872 …(PFN_vkCmdBuildAccelerationStructureNV)vkGetDeviceProcAddr(as->dev(), "vkCmdBuildAccelerationStruc… in BuildAccelerationStructure()
1875 …vkCmdBuildAccelerationStructureNV(handle(), &as->info(), instanceData, 0, VK_FALSE, as->handle(), … in BuildAccelerationStructure()
1882 … color_att->SetLayout(this, VK_IMAGE_ASPECT_COLOR_BIT, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL); in PrepareAttachments()
1885 if (depth_stencil_att && depth_stencil_att->Initialized()) { in PrepareAttachments()
1887 if (FormatIsDepthOnly(depth_stencil_att->Format())) aspect = VK_IMAGE_ASPECT_DEPTH_BIT; in PrepareAttachments()
1888 if (FormatIsStencilOnly(depth_stencil_att->Format())) aspect = VK_IMAGE_ASPECT_STENCIL_BIT; in PrepareAttachments()
1890 … depth_stencil_att->SetLayout(this, aspect, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); in PrepareAttachments()
1925 err = m_queue->submit(*this, fence, checkSuccess); in QueueCommandBuffer()
1930 err = m_queue->wait(); in QueueCommandBuffer()
1937 vkDeviceWaitIdle(m_device->device()); in QueueCommandBuffer()
1951 vkCmdBindIndexBuffer(handle(), indexBuffer->handle(), offset, indexType); in BindIndexBuffer()
1955 vkCmdBindVertexBuffers(handle(), binding, 1, &vertexBuffer->handle(), &offset); in BindVertexBuffer()
1967 VkFormat VkDepthStencilObj::Format() const { return this->m_depth_stencil_fmt; } in Format()