diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 6 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 20 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 8 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/maxwell_to_gl.h | 5 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/fixed_pipeline_state.cpp | 8 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/fixed_pipeline_state.h | 7 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/maxwell_to_vk.cpp | 23 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/maxwell_to_vk.h | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_device.cpp | 5 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_device.h | 6 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | 32 |
11 files changed, 121 insertions, 1 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index 33936e209..024c9e43b 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -44,6 +44,12 @@ void Maxwell3D::InitializeRegisterDefaults() { | |||
| 44 | viewport.depth_range_near = 0.0f; | 44 | viewport.depth_range_near = 0.0f; |
| 45 | viewport.depth_range_far = 1.0f; | 45 | viewport.depth_range_far = 1.0f; |
| 46 | } | 46 | } |
| 47 | for (auto& viewport : regs.viewport_transform) { | ||
| 48 | viewport.swizzle.x.Assign(Regs::ViewportSwizzle::PositiveX); | ||
| 49 | viewport.swizzle.y.Assign(Regs::ViewportSwizzle::PositiveY); | ||
| 50 | viewport.swizzle.z.Assign(Regs::ViewportSwizzle::PositiveZ); | ||
| 51 | viewport.swizzle.w.Assign(Regs::ViewportSwizzle::PositiveW); | ||
| 52 | } | ||
| 47 | 53 | ||
| 48 | // Doom and Bomberman seems to use the uninitialized registers and just enable blend | 54 | // Doom and Bomberman seems to use the uninitialized registers and just enable blend |
| 49 | // so initialize blend registers with sane values | 55 | // so initialize blend registers with sane values |
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 1a5df05ce..05dd6b39b 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -576,6 +576,17 @@ public: | |||
| 576 | Replay = 3, | 576 | Replay = 3, |
| 577 | }; | 577 | }; |
| 578 | 578 | ||
| 579 | enum class ViewportSwizzle : u32 { | ||
| 580 | PositiveX = 0, | ||
| 581 | NegativeX = 1, | ||
| 582 | PositiveY = 2, | ||
| 583 | NegativeY = 3, | ||
| 584 | PositiveZ = 4, | ||
| 585 | NegativeZ = 5, | ||
| 586 | PositiveW = 6, | ||
| 587 | NegativeW = 7, | ||
| 588 | }; | ||
| 589 | |||
| 579 | struct RenderTargetConfig { | 590 | struct RenderTargetConfig { |
| 580 | u32 address_high; | 591 | u32 address_high; |
| 581 | u32 address_low; | 592 | u32 address_low; |
| @@ -619,7 +630,14 @@ public: | |||
| 619 | f32 translate_x; | 630 | f32 translate_x; |
| 620 | f32 translate_y; | 631 | f32 translate_y; |
| 621 | f32 translate_z; | 632 | f32 translate_z; |
| 622 | INSERT_UNION_PADDING_WORDS(2); | 633 | union { |
| 634 | u32 raw; | ||
| 635 | BitField<0, 3, ViewportSwizzle> x; | ||
| 636 | BitField<4, 3, ViewportSwizzle> y; | ||
| 637 | BitField<8, 3, ViewportSwizzle> z; | ||
| 638 | BitField<12, 3, ViewportSwizzle> w; | ||
| 639 | } swizzle; | ||
| 640 | INSERT_UNION_PADDING_WORDS(1); | ||
| 623 | 641 | ||
| 624 | Common::Rectangle<f32> GetRect() const { | 642 | Common::Rectangle<f32> GetRect() const { |
| 625 | return { | 643 | return { |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 8b3b3ce92..69dcf952f 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -1019,6 +1019,14 @@ void RasterizerOpenGL::SyncViewport() { | |||
| 1019 | const GLdouble near_depth = src.translate_z - src.scale_z * reduce_z; | 1019 | const GLdouble near_depth = src.translate_z - src.scale_z * reduce_z; |
| 1020 | const GLdouble far_depth = src.translate_z + src.scale_z; | 1020 | const GLdouble far_depth = src.translate_z + src.scale_z; |
| 1021 | glDepthRangeIndexed(static_cast<GLuint>(i), near_depth, far_depth); | 1021 | glDepthRangeIndexed(static_cast<GLuint>(i), near_depth, far_depth); |
| 1022 | |||
| 1023 | if (!GLAD_GL_NV_viewport_swizzle) { | ||
| 1024 | continue; | ||
| 1025 | } | ||
| 1026 | glViewportSwizzleNV(static_cast<GLuint>(i), MaxwellToGL::ViewportSwizzle(src.swizzle.x), | ||
| 1027 | MaxwellToGL::ViewportSwizzle(src.swizzle.y), | ||
| 1028 | MaxwellToGL::ViewportSwizzle(src.swizzle.z), | ||
| 1029 | MaxwellToGL::ViewportSwizzle(src.swizzle.w)); | ||
| 1022 | } | 1030 | } |
| 1023 | } | 1031 | } |
| 1024 | } | 1032 | } |
diff --git a/src/video_core/renderer_opengl/maxwell_to_gl.h b/src/video_core/renderer_opengl/maxwell_to_gl.h index 2c0c77c28..994ae98eb 100644 --- a/src/video_core/renderer_opengl/maxwell_to_gl.h +++ b/src/video_core/renderer_opengl/maxwell_to_gl.h | |||
| @@ -503,5 +503,10 @@ inline GLenum PolygonMode(Maxwell::PolygonMode polygon_mode) { | |||
| 503 | return GL_FILL; | 503 | return GL_FILL; |
| 504 | } | 504 | } |
| 505 | 505 | ||
| 506 | inline GLenum ViewportSwizzle(Maxwell::ViewportSwizzle swizzle) { | ||
| 507 | // Enumeration order matches register order. We can convert it arithmetically. | ||
| 508 | return GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV + static_cast<GLenum>(swizzle); | ||
| 509 | } | ||
| 510 | |||
| 506 | } // namespace MaxwellToGL | 511 | } // namespace MaxwellToGL |
| 507 | } // namespace OpenGL | 512 | } // namespace OpenGL |
diff --git a/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp b/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp index 648b1e71b..6cead3a28 100644 --- a/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp +++ b/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <algorithm> | ||
| 5 | #include <cstring> | 6 | #include <cstring> |
| 6 | #include <tuple> | 7 | #include <tuple> |
| 7 | 8 | ||
| @@ -101,6 +102,12 @@ void FixedPipelineState::ColorBlending::Fill(const Maxwell& regs) noexcept { | |||
| 101 | } | 102 | } |
| 102 | } | 103 | } |
| 103 | 104 | ||
| 105 | void FixedPipelineState::ViewportSwizzles::Fill(const Maxwell& regs) noexcept { | ||
| 106 | const auto& transform = regs.viewport_transform; | ||
| 107 | std::transform(transform.begin(), transform.end(), swizzles.begin(), | ||
| 108 | [](const auto& viewport) { return static_cast<u16>(viewport.swizzle.raw); }); | ||
| 109 | } | ||
| 110 | |||
| 104 | void FixedPipelineState::BlendingAttachment::Fill(const Maxwell& regs, std::size_t index) { | 111 | void FixedPipelineState::BlendingAttachment::Fill(const Maxwell& regs, std::size_t index) { |
| 105 | const auto& mask = regs.color_mask[regs.color_mask_common ? 0 : index]; | 112 | const auto& mask = regs.color_mask[regs.color_mask_common ? 0 : index]; |
| 106 | 113 | ||
| @@ -144,6 +151,7 @@ void FixedPipelineState::Fill(const Maxwell& regs) { | |||
| 144 | rasterizer.Fill(regs); | 151 | rasterizer.Fill(regs); |
| 145 | depth_stencil.Fill(regs); | 152 | depth_stencil.Fill(regs); |
| 146 | color_blending.Fill(regs); | 153 | color_blending.Fill(regs); |
| 154 | viewport_swizzles.Fill(regs); | ||
| 147 | } | 155 | } |
| 148 | 156 | ||
| 149 | std::size_t FixedPipelineState::Hash() const noexcept { | 157 | std::size_t FixedPipelineState::Hash() const noexcept { |
diff --git a/src/video_core/renderer_vulkan/fixed_pipeline_state.h b/src/video_core/renderer_vulkan/fixed_pipeline_state.h index 8652067a7..cecaee48d 100644 --- a/src/video_core/renderer_vulkan/fixed_pipeline_state.h +++ b/src/video_core/renderer_vulkan/fixed_pipeline_state.h | |||
| @@ -233,10 +233,17 @@ struct FixedPipelineState { | |||
| 233 | void Fill(const Maxwell& regs) noexcept; | 233 | void Fill(const Maxwell& regs) noexcept; |
| 234 | }; | 234 | }; |
| 235 | 235 | ||
| 236 | struct ViewportSwizzles { | ||
| 237 | std::array<u16, Maxwell::NumViewports> swizzles; | ||
| 238 | |||
| 239 | void Fill(const Maxwell& regs) noexcept; | ||
| 240 | }; | ||
| 241 | |||
| 236 | VertexInput vertex_input; | 242 | VertexInput vertex_input; |
| 237 | Rasterizer rasterizer; | 243 | Rasterizer rasterizer; |
| 238 | DepthStencil depth_stencil; | 244 | DepthStencil depth_stencil; |
| 239 | ColorBlending color_blending; | 245 | ColorBlending color_blending; |
| 246 | ViewportSwizzles viewport_swizzles; | ||
| 240 | 247 | ||
| 241 | void Fill(const Maxwell& regs); | 248 | void Fill(const Maxwell& regs); |
| 242 | 249 | ||
diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp index 8681b821f..850165606 100644 --- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp +++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp | |||
| @@ -672,4 +672,27 @@ VkComponentSwizzle SwizzleSource(Tegra::Texture::SwizzleSource swizzle) { | |||
| 672 | return {}; | 672 | return {}; |
| 673 | } | 673 | } |
| 674 | 674 | ||
| 675 | VkViewportCoordinateSwizzleNV ViewportSwizzle(Maxwell::ViewportSwizzle swizzle) { | ||
| 676 | switch (swizzle) { | ||
| 677 | case Maxwell::ViewportSwizzle::PositiveX: | ||
| 678 | return VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV; | ||
| 679 | case Maxwell::ViewportSwizzle::NegativeX: | ||
| 680 | return VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_X_NV; | ||
| 681 | case Maxwell::ViewportSwizzle::PositiveY: | ||
| 682 | return VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Y_NV; | ||
| 683 | case Maxwell::ViewportSwizzle::NegativeY: | ||
| 684 | return VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Y_NV; | ||
| 685 | case Maxwell::ViewportSwizzle::PositiveZ: | ||
| 686 | return VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_Z_NV; | ||
| 687 | case Maxwell::ViewportSwizzle::NegativeZ: | ||
| 688 | return VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_Z_NV; | ||
| 689 | case Maxwell::ViewportSwizzle::PositiveW: | ||
| 690 | return VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_W_NV; | ||
| 691 | case Maxwell::ViewportSwizzle::NegativeW: | ||
| 692 | return VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV; | ||
| 693 | } | ||
| 694 | UNREACHABLE_MSG("Invalid swizzle={}", static_cast<int>(swizzle)); | ||
| 695 | return {}; | ||
| 696 | } | ||
| 697 | |||
| 675 | } // namespace Vulkan::MaxwellToVK | 698 | } // namespace Vulkan::MaxwellToVK |
diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.h b/src/video_core/renderer_vulkan/maxwell_to_vk.h index 81bce4c6c..7e213452f 100644 --- a/src/video_core/renderer_vulkan/maxwell_to_vk.h +++ b/src/video_core/renderer_vulkan/maxwell_to_vk.h | |||
| @@ -59,4 +59,6 @@ VkCullModeFlags CullFace(Maxwell::CullFace cull_face); | |||
| 59 | 59 | ||
| 60 | VkComponentSwizzle SwizzleSource(Tegra::Texture::SwizzleSource swizzle); | 60 | VkComponentSwizzle SwizzleSource(Tegra::Texture::SwizzleSource swizzle); |
| 61 | 61 | ||
| 62 | VkViewportCoordinateSwizzleNV ViewportSwizzle(Maxwell::ViewportSwizzle swizzle); | ||
| 63 | |||
| 62 | } // namespace Vulkan::MaxwellToVK | 64 | } // namespace Vulkan::MaxwellToVK |
diff --git a/src/video_core/renderer_vulkan/vk_device.cpp b/src/video_core/renderer_vulkan/vk_device.cpp index 09ddfa59c..170cdaed0 100644 --- a/src/video_core/renderer_vulkan/vk_device.cpp +++ b/src/video_core/renderer_vulkan/vk_device.cpp | |||
| @@ -260,6 +260,10 @@ bool VKDevice::Create() { | |||
| 260 | LOG_INFO(Render_Vulkan, "Device doesn't support float16 natively"); | 260 | LOG_INFO(Render_Vulkan, "Device doesn't support float16 natively"); |
| 261 | } | 261 | } |
| 262 | 262 | ||
| 263 | if (!nv_viewport_swizzle) { | ||
| 264 | LOG_INFO(Render_Vulkan, "Device doesn't support viewport swizzles"); | ||
| 265 | } | ||
| 266 | |||
| 263 | VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR std430_layout; | 267 | VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR std430_layout; |
| 264 | if (khr_uniform_buffer_standard_layout) { | 268 | if (khr_uniform_buffer_standard_layout) { |
| 265 | std430_layout.sType = | 269 | std430_layout.sType = |
| @@ -533,6 +537,7 @@ std::vector<const char*> VKDevice::LoadExtensions() { | |||
| 533 | bool has_ext_transform_feedback{}; | 537 | bool has_ext_transform_feedback{}; |
| 534 | bool has_ext_custom_border_color{}; | 538 | bool has_ext_custom_border_color{}; |
| 535 | for (const auto& extension : physical.EnumerateDeviceExtensionProperties()) { | 539 | for (const auto& extension : physical.EnumerateDeviceExtensionProperties()) { |
| 540 | Test(extension, nv_viewport_swizzle, VK_NV_VIEWPORT_SWIZZLE_EXTENSION_NAME, true); | ||
| 536 | Test(extension, khr_uniform_buffer_standard_layout, | 541 | Test(extension, khr_uniform_buffer_standard_layout, |
| 537 | VK_KHR_UNIFORM_BUFFER_STANDARD_LAYOUT_EXTENSION_NAME, true); | 542 | VK_KHR_UNIFORM_BUFFER_STANDARD_LAYOUT_EXTENSION_NAME, true); |
| 538 | Test(extension, has_khr_shader_float16_int8, VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME, | 543 | Test(extension, has_khr_shader_float16_int8, VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME, |
diff --git a/src/video_core/renderer_vulkan/vk_device.h b/src/video_core/renderer_vulkan/vk_device.h index ccdf82754..6b9227b09 100644 --- a/src/video_core/renderer_vulkan/vk_device.h +++ b/src/video_core/renderer_vulkan/vk_device.h | |||
| @@ -147,6 +147,11 @@ public: | |||
| 147 | return is_formatless_image_load_supported; | 147 | return is_formatless_image_load_supported; |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | /// Returns true if the device supports VK_NV_viewport_swizzle. | ||
| 151 | bool IsNvViewportSwizzleSupported() const { | ||
| 152 | return nv_viewport_swizzle; | ||
| 153 | } | ||
| 154 | |||
| 150 | /// Returns true if the device supports VK_EXT_scalar_block_layout. | 155 | /// Returns true if the device supports VK_EXT_scalar_block_layout. |
| 151 | bool IsKhrUniformBufferStandardLayoutSupported() const { | 156 | bool IsKhrUniformBufferStandardLayoutSupported() const { |
| 152 | return khr_uniform_buffer_standard_layout; | 157 | return khr_uniform_buffer_standard_layout; |
| @@ -227,6 +232,7 @@ private: | |||
| 227 | bool is_float16_supported{}; ///< Support for float16 arithmetics. | 232 | bool is_float16_supported{}; ///< Support for float16 arithmetics. |
| 228 | bool is_warp_potentially_bigger{}; ///< Host warp size can be bigger than guest. | 233 | bool is_warp_potentially_bigger{}; ///< Host warp size can be bigger than guest. |
| 229 | bool is_formatless_image_load_supported{}; ///< Support for shader image read without format. | 234 | bool is_formatless_image_load_supported{}; ///< Support for shader image read without format. |
| 235 | bool nv_viewport_swizzle{}; ///< Support for VK_NV_viewport_swizzle. | ||
| 230 | bool khr_uniform_buffer_standard_layout{}; ///< Support for std430 on UBOs. | 236 | bool khr_uniform_buffer_standard_layout{}; ///< Support for std430 on UBOs. |
| 231 | bool ext_index_type_uint8{}; ///< Support for VK_EXT_index_type_uint8. | 237 | bool ext_index_type_uint8{}; ///< Support for VK_EXT_index_type_uint8. |
| 232 | bool ext_depth_range_unrestricted{}; ///< Support for VK_EXT_depth_range_unrestricted. | 238 | bool ext_depth_range_unrestricted{}; ///< Support for VK_EXT_depth_range_unrestricted. |
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index 1ac981974..5beea6a03 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <algorithm> | ||
| 5 | #include <array> | 6 | #include <array> |
| 6 | #include <cstring> | 7 | #include <cstring> |
| 7 | #include <vector> | 8 | #include <vector> |
| @@ -50,6 +51,23 @@ bool SupportsPrimitiveRestart(VkPrimitiveTopology topology) { | |||
| 50 | topology) == std::end(unsupported_topologies); | 51 | topology) == std::end(unsupported_topologies); |
| 51 | } | 52 | } |
| 52 | 53 | ||
| 54 | VkViewportSwizzleNV UnpackViewportSwizzle(u16 swizzle) { | ||
| 55 | union { | ||
| 56 | u32 raw; | ||
| 57 | BitField<0, 3, Maxwell::ViewportSwizzle> x; | ||
| 58 | BitField<4, 3, Maxwell::ViewportSwizzle> y; | ||
| 59 | BitField<8, 3, Maxwell::ViewportSwizzle> z; | ||
| 60 | BitField<12, 3, Maxwell::ViewportSwizzle> w; | ||
| 61 | } const unpacked{swizzle}; | ||
| 62 | |||
| 63 | VkViewportSwizzleNV result; | ||
| 64 | result.x = MaxwellToVK::ViewportSwizzle(unpacked.x); | ||
| 65 | result.y = MaxwellToVK::ViewportSwizzle(unpacked.y); | ||
| 66 | result.z = MaxwellToVK::ViewportSwizzle(unpacked.z); | ||
| 67 | result.w = MaxwellToVK::ViewportSwizzle(unpacked.w); | ||
| 68 | return result; | ||
| 69 | } | ||
| 70 | |||
| 53 | } // Anonymous namespace | 71 | } // Anonymous namespace |
| 54 | 72 | ||
| 55 | VKGraphicsPipeline::VKGraphicsPipeline(const VKDevice& device, VKScheduler& scheduler, | 73 | VKGraphicsPipeline::VKGraphicsPipeline(const VKDevice& device, VKScheduler& scheduler, |
| @@ -162,6 +180,7 @@ vk::Pipeline VKGraphicsPipeline::CreatePipeline(const RenderPassParams& renderpa | |||
| 162 | const auto& ds = fixed_state.depth_stencil; | 180 | const auto& ds = fixed_state.depth_stencil; |
| 163 | const auto& cd = fixed_state.color_blending; | 181 | const auto& cd = fixed_state.color_blending; |
| 164 | const auto& rs = fixed_state.rasterizer; | 182 | const auto& rs = fixed_state.rasterizer; |
| 183 | const auto& viewport_swizzles = fixed_state.viewport_swizzles.swizzles; | ||
| 165 | 184 | ||
| 166 | std::vector<VkVertexInputBindingDescription> vertex_bindings; | 185 | std::vector<VkVertexInputBindingDescription> vertex_bindings; |
| 167 | std::vector<VkVertexInputBindingDivisorDescriptionEXT> vertex_binding_divisors; | 186 | std::vector<VkVertexInputBindingDivisorDescriptionEXT> vertex_binding_divisors; |
| @@ -244,6 +263,19 @@ vk::Pipeline VKGraphicsPipeline::CreatePipeline(const RenderPassParams& renderpa | |||
| 244 | viewport_ci.scissorCount = Maxwell::NumViewports; | 263 | viewport_ci.scissorCount = Maxwell::NumViewports; |
| 245 | viewport_ci.pScissors = nullptr; | 264 | viewport_ci.pScissors = nullptr; |
| 246 | 265 | ||
| 266 | std::array<VkViewportSwizzleNV, Maxwell::NumViewports> swizzles; | ||
| 267 | std::transform(viewport_swizzles.begin(), viewport_swizzles.end(), swizzles.begin(), | ||
| 268 | UnpackViewportSwizzle); | ||
| 269 | VkPipelineViewportSwizzleStateCreateInfoNV swizzle_ci; | ||
| 270 | swizzle_ci.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV; | ||
| 271 | swizzle_ci.pNext = nullptr; | ||
| 272 | swizzle_ci.flags = 0; | ||
| 273 | swizzle_ci.viewportCount = Maxwell::NumViewports; | ||
| 274 | swizzle_ci.pViewportSwizzles = swizzles.data(); | ||
| 275 | if (device.IsNvViewportSwizzleSupported()) { | ||
| 276 | viewport_ci.pNext = &swizzle_ci; | ||
| 277 | } | ||
| 278 | |||
| 247 | VkPipelineRasterizationStateCreateInfo rasterization_ci; | 279 | VkPipelineRasterizationStateCreateInfo rasterization_ci; |
| 248 | rasterization_ci.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO; | 280 | rasterization_ci.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO; |
| 249 | rasterization_ci.pNext = nullptr; | 281 | rasterization_ci.pNext = nullptr; |