diff options
Diffstat (limited to 'src/shader_recompiler')
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp | 8 | ||||
| -rw-r--r-- | src/shader_recompiler/object_pool.h | 6 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp index 68f360b3c..6f60c6574 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp | |||
| @@ -477,7 +477,13 @@ void EmitSetSampleMask(EmitContext& ctx, Id value) { | |||
| 477 | } | 477 | } |
| 478 | 478 | ||
| 479 | void EmitSetFragDepth(EmitContext& ctx, Id value) { | 479 | void EmitSetFragDepth(EmitContext& ctx, Id value) { |
| 480 | ctx.OpStore(ctx.frag_depth, value); | 480 | if (!ctx.runtime_info.convert_depth_mode) { |
| 481 | ctx.OpStore(ctx.frag_depth, value); | ||
| 482 | return; | ||
| 483 | } | ||
| 484 | const Id unit{ctx.Const(0.5f)}; | ||
| 485 | const Id new_depth{ctx.OpFma(ctx.F32[1], value, unit, unit)}; | ||
| 486 | ctx.OpStore(ctx.frag_depth, new_depth); | ||
| 481 | } | 487 | } |
| 482 | 488 | ||
| 483 | void EmitGetZFlag(EmitContext&) { | 489 | void EmitGetZFlag(EmitContext&) { |
diff --git a/src/shader_recompiler/object_pool.h b/src/shader_recompiler/object_pool.h index f3b12d04b..a12ddcc8f 100644 --- a/src/shader_recompiler/object_pool.h +++ b/src/shader_recompiler/object_pool.h | |||
| @@ -11,14 +11,16 @@ | |||
| 11 | namespace Shader { | 11 | namespace Shader { |
| 12 | 12 | ||
| 13 | template <typename T> | 13 | template <typename T> |
| 14 | requires std::is_destructible_v<T> class ObjectPool { | 14 | requires std::is_destructible_v<T> |
| 15 | class ObjectPool { | ||
| 15 | public: | 16 | public: |
| 16 | explicit ObjectPool(size_t chunk_size = 8192) : new_chunk_size{chunk_size} { | 17 | explicit ObjectPool(size_t chunk_size = 8192) : new_chunk_size{chunk_size} { |
| 17 | node = &chunks.emplace_back(new_chunk_size); | 18 | node = &chunks.emplace_back(new_chunk_size); |
| 18 | } | 19 | } |
| 19 | 20 | ||
| 20 | template <typename... Args> | 21 | template <typename... Args> |
| 21 | requires std::is_constructible_v<T, Args...>[[nodiscard]] T* Create(Args&&... args) { | 22 | requires std::is_constructible_v<T, Args...> |
| 23 | [[nodiscard]] T* Create(Args&&... args) { | ||
| 22 | return std::construct_at(Memory(), std::forward<Args>(args)...); | 24 | return std::construct_at(Memory(), std::forward<Args>(args)...); |
| 23 | } | 25 | } |
| 24 | 26 | ||