-----------------------------------------------------------------------------------
| 403 | } |
| 404 | //----------------------------------------------------------------------------------- |
| 405 | ResourceLayout::Layout VulkanTextureGpu::getCurrentLayout() const |
| 406 | { |
| 407 | // These are usually counterpart of VulkanMappings::get. |
| 408 | // Otherwise there could be asserts triggering in our validations |
| 409 | switch( mCurrLayout ) |
| 410 | { |
| 411 | case VK_IMAGE_LAYOUT_UNDEFINED: |
| 412 | return ResourceLayout::Undefined; |
| 413 | case VK_IMAGE_LAYOUT_GENERAL: |
| 414 | return ResourceLayout::Uav; |
| 415 | case VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL: |
| 416 | case VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL: |
| 417 | return ResourceLayout::RenderTarget; |
| 418 | case VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL: |
| 419 | return ResourceLayout::RenderTargetReadOnly; |
| 420 | case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL: |
| 421 | return ResourceLayout::Texture; |
| 422 | case VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL: |
| 423 | return ResourceLayout::CopySrc; |
| 424 | case VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL: |
| 425 | return ResourceLayout::CopyDst; |
| 426 | case VK_IMAGE_LAYOUT_PREINITIALIZED: |
| 427 | return ResourceLayout::Undefined; |
| 428 | case VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL: |
| 429 | case VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL: |
| 430 | return ResourceLayout::RenderTarget; |
| 431 | case VK_IMAGE_LAYOUT_PRESENT_SRC_KHR: |
| 432 | return ResourceLayout::PresentReady; |
| 433 | case VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR: |
| 434 | case VK_IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV: |
| 435 | case VK_IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT: |
| 436 | case VK_IMAGE_LAYOUT_MAX_ENUM: |
| 437 | return ResourceLayout::Undefined; |
| 438 | |
| 439 | case VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL: |
| 440 | case VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL: |
| 441 | // We literally never set these layouts. This case is here to silence the compiler |
| 442 | OGRE_ASSERT_MEDIUM( false && "Unimplemented. How are you here?" ); |
| 443 | return ResourceLayout::RenderTarget; |
| 444 | case VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL: |
| 445 | case VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL: |
| 446 | // We literally never set these layouts. This case is here to silence the compiler |
| 447 | OGRE_ASSERT_MEDIUM( false && "Unimplemented. How are you here?" ); |
| 448 | return ResourceLayout::RenderTargetReadOnly; |
| 449 | } |
| 450 | |
| 451 | return ResourceLayout::Undefined; |
| 452 | } |
| 453 | //----------------------------------------------------------------------------------- |
| 454 | void VulkanTextureGpu::setTextureType( TextureTypes::TextureTypes textureType ) |
| 455 | { |