summaryrefslogtreecommitdiff
path: root/src/shader_recompiler
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler')
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp8
-rw-r--r--src/shader_recompiler/object_pool.h6
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
479void EmitSetFragDepth(EmitContext& ctx, Id value) { 479void 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
483void EmitGetZFlag(EmitContext&) { 489void 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 @@
11namespace Shader { 11namespace Shader {
12 12
13template <typename T> 13template <typename T>
14requires std::is_destructible_v<T> class ObjectPool { 14requires std::is_destructible_v<T>
15class ObjectPool {
15public: 16public:
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