diff options
| author | 2024-02-22 11:30:26 -0600 | |
|---|---|---|
| committer | 2024-02-22 11:30:26 -0600 | |
| commit | 4f95ee52097762fcd53c135fcf07511898c48194 (patch) | |
| tree | 1773373bf6c4b9b2556e7352b5de469bd9859695 | |
| parent | Merge pull request #13105 from t895/connection-fix (diff) | |
| parent | shader_recompiler: throw on missing geometry streams in geometry shaders (diff) | |
| download | yuzu-4f95ee52097762fcd53c135fcf07511898c48194.tar.gz yuzu-4f95ee52097762fcd53c135fcf07511898c48194.tar.xz yuzu-4f95ee52097762fcd53c135fcf07511898c48194.zip | |
Merge pull request #13075 from liamwhite/mali-having-a-bad-time
shader_recompiler: throw on missing geometry streams in geometry shaders
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv.cpp | 4 | ||||
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv_special.cpp | 8 | ||||
| -rw-r--r-- | src/shader_recompiler/profile.h | 1 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | 1 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_device.h | 5 |
5 files changed, 16 insertions, 3 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.cpp b/src/shader_recompiler/backend/spirv/emit_spirv.cpp index 0031fa5fb..3f9698d6b 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv.cpp | |||
| @@ -261,7 +261,9 @@ void DefineEntryPoint(const IR::Program& program, EmitContext& ctx, Id main) { | |||
| 261 | case Stage::Geometry: | 261 | case Stage::Geometry: |
| 262 | execution_model = spv::ExecutionModel::Geometry; | 262 | execution_model = spv::ExecutionModel::Geometry; |
| 263 | ctx.AddCapability(spv::Capability::Geometry); | 263 | ctx.AddCapability(spv::Capability::Geometry); |
| 264 | ctx.AddCapability(spv::Capability::GeometryStreams); | 264 | if (ctx.profile.support_geometry_streams) { |
| 265 | ctx.AddCapability(spv::Capability::GeometryStreams); | ||
| 266 | } | ||
| 265 | switch (ctx.runtime_info.input_topology) { | 267 | switch (ctx.runtime_info.input_topology) { |
| 266 | case InputTopology::Points: | 268 | case InputTopology::Points: |
| 267 | ctx.AddExecutionMode(main, spv::ExecutionMode::InputPoints); | 269 | ctx.AddExecutionMode(main, spv::ExecutionMode::InputPoints); |
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp index 9f7b6bb4b..f60da758e 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp | |||
| @@ -129,7 +129,9 @@ void EmitEmitVertex(EmitContext& ctx, const IR::Value& stream) { | |||
| 129 | if (ctx.runtime_info.convert_depth_mode && !ctx.profile.support_native_ndc) { | 129 | if (ctx.runtime_info.convert_depth_mode && !ctx.profile.support_native_ndc) { |
| 130 | ConvertDepthMode(ctx); | 130 | ConvertDepthMode(ctx); |
| 131 | } | 131 | } |
| 132 | if (stream.IsImmediate()) { | 132 | if (!ctx.profile.support_geometry_streams) { |
| 133 | throw NotImplementedException("Geometry streams"); | ||
| 134 | } else if (stream.IsImmediate()) { | ||
| 133 | ctx.OpEmitStreamVertex(ctx.Def(stream)); | 135 | ctx.OpEmitStreamVertex(ctx.Def(stream)); |
| 134 | } else { | 136 | } else { |
| 135 | LOG_WARNING(Shader_SPIRV, "Stream is not immediate"); | 137 | LOG_WARNING(Shader_SPIRV, "Stream is not immediate"); |
| @@ -140,7 +142,9 @@ void EmitEmitVertex(EmitContext& ctx, const IR::Value& stream) { | |||
| 140 | } | 142 | } |
| 141 | 143 | ||
| 142 | void EmitEndPrimitive(EmitContext& ctx, const IR::Value& stream) { | 144 | void EmitEndPrimitive(EmitContext& ctx, const IR::Value& stream) { |
| 143 | if (stream.IsImmediate()) { | 145 | if (!ctx.profile.support_geometry_streams) { |
| 146 | throw NotImplementedException("Geometry streams"); | ||
| 147 | } else if (stream.IsImmediate()) { | ||
| 144 | ctx.OpEndStreamPrimitive(ctx.Def(stream)); | 148 | ctx.OpEndStreamPrimitive(ctx.Def(stream)); |
| 145 | } else { | 149 | } else { |
| 146 | LOG_WARNING(Shader_SPIRV, "Stream is not immediate"); | 150 | LOG_WARNING(Shader_SPIRV, "Stream is not immediate"); |
diff --git a/src/shader_recompiler/profile.h b/src/shader_recompiler/profile.h index 7578d41cc..90e46bb1b 100644 --- a/src/shader_recompiler/profile.h +++ b/src/shader_recompiler/profile.h | |||
| @@ -44,6 +44,7 @@ struct Profile { | |||
| 44 | bool support_gl_derivative_control{}; | 44 | bool support_gl_derivative_control{}; |
| 45 | bool support_scaled_attributes{}; | 45 | bool support_scaled_attributes{}; |
| 46 | bool support_multi_viewport{}; | 46 | bool support_multi_viewport{}; |
| 47 | bool support_geometry_streams{}; | ||
| 47 | 48 | ||
| 48 | bool warp_size_potentially_larger_than_guest{}; | 49 | bool warp_size_potentially_larger_than_guest{}; |
| 49 | 50 | ||
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 20f7a9702..d34b585d6 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | |||
| @@ -352,6 +352,7 @@ PipelineCache::PipelineCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, | |||
| 352 | .support_native_ndc = device.IsExtDepthClipControlSupported(), | 352 | .support_native_ndc = device.IsExtDepthClipControlSupported(), |
| 353 | .support_scaled_attributes = !device.MustEmulateScaledFormats(), | 353 | .support_scaled_attributes = !device.MustEmulateScaledFormats(), |
| 354 | .support_multi_viewport = device.SupportsMultiViewport(), | 354 | .support_multi_viewport = device.SupportsMultiViewport(), |
| 355 | .support_geometry_streams = device.AreTransformFeedbackGeometryStreamsSupported(), | ||
| 355 | 356 | ||
| 356 | .warp_size_potentially_larger_than_guest = device.IsWarpSizePotentiallyBiggerThanGuest(), | 357 | .warp_size_potentially_larger_than_guest = device.IsWarpSizePotentiallyBiggerThanGuest(), |
| 357 | 358 | ||
diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index a2ec26697..e3abe8ddf 100644 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h | |||
| @@ -499,6 +499,11 @@ public: | |||
| 499 | return extensions.transform_feedback; | 499 | return extensions.transform_feedback; |
| 500 | } | 500 | } |
| 501 | 501 | ||
| 502 | /// Returns true if the device supports VK_EXT_transform_feedback properly. | ||
| 503 | bool AreTransformFeedbackGeometryStreamsSupported() const { | ||
| 504 | return features.transform_feedback.geometryStreams; | ||
| 505 | } | ||
| 506 | |||
| 502 | /// Returns true if the device supports VK_EXT_custom_border_color. | 507 | /// Returns true if the device supports VK_EXT_custom_border_color. |
| 503 | bool IsExtCustomBorderColorSupported() const { | 508 | bool IsExtCustomBorderColorSupported() const { |
| 504 | return extensions.custom_border_color; | 509 | return extensions.custom_border_color; |