Browse Source
Merge pull request #7017 from FernandoS27/i-am-barbie-girl
Spir-V: Rescale the frag depth to 0,1 mode when -1,1 mode is used in Vulkan.
pull/15/merge
Ameer J
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
1 deletions
-
src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp
|
|
@ -477,7 +477,13 @@ void EmitSetSampleMask(EmitContext& ctx, Id value) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void EmitSetFragDepth(EmitContext& ctx, Id value) { |
|
|
void EmitSetFragDepth(EmitContext& ctx, Id value) { |
|
|
ctx.OpStore(ctx.frag_depth, value); |
|
|
|
|
|
|
|
|
if (!ctx.runtime_info.convert_depth_mode) { |
|
|
|
|
|
ctx.OpStore(ctx.frag_depth, value); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
const Id unit{ctx.Const(0.5f)}; |
|
|
|
|
|
const Id new_depth{ctx.OpFma(ctx.F32[1], value, unit, unit)}; |
|
|
|
|
|
ctx.OpStore(ctx.frag_depth, new_depth); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void EmitGetZFlag(EmitContext&) { |
|
|
void EmitGetZFlag(EmitContext&) { |
|
|
|