diff options
| author | 2021-04-16 23:52:58 +0200 | |
|---|---|---|
| committer | 2021-07-22 21:51:28 -0400 | |
| commit | f18a6dd1bdaffda4c3e771af3cf7cf41919ebd67 (patch) | |
| tree | ffd531d2a81f9e48369c7f362e11e224f437fd5c /src/shader_recompiler/backend/spirv | |
| parent | shader: Fix Phi node types (diff) | |
| download | yuzu-f18a6dd1bdaffda4c3e771af3cf7cf41919ebd67.tar.gz yuzu-f18a6dd1bdaffda4c3e771af3cf7cf41919ebd67.tar.xz yuzu-f18a6dd1bdaffda4c3e771af3cf7cf41919ebd67.zip | |
shader: Implement SR_Y_DIRECTION
Diffstat (limited to 'src/shader_recompiler/backend/spirv')
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv.h | 1 | ||||
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.h b/src/shader_recompiler/backend/spirv/emit_spirv.h index d43c72f6e..7949d08d0 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv.h +++ b/src/shader_recompiler/backend/spirv/emit_spirv.h | |||
| @@ -72,6 +72,7 @@ Id EmitLocalInvocationId(EmitContext& ctx); | |||
| 72 | Id EmitInvocationId(EmitContext& ctx); | 72 | Id EmitInvocationId(EmitContext& ctx); |
| 73 | Id EmitSampleId(EmitContext& ctx); | 73 | Id EmitSampleId(EmitContext& ctx); |
| 74 | Id EmitIsHelperInvocation(EmitContext& ctx); | 74 | Id EmitIsHelperInvocation(EmitContext& ctx); |
| 75 | Id EmitYDirection(EmitContext& ctx); | ||
| 75 | Id EmitLoadLocal(EmitContext& ctx, Id word_offset); | 76 | Id EmitLoadLocal(EmitContext& ctx, Id word_offset); |
| 76 | void EmitWriteLocal(EmitContext& ctx, Id word_offset, Id value); | 77 | void EmitWriteLocal(EmitContext& ctx, Id word_offset, Id value); |
| 77 | Id EmitUndefU1(EmitContext& ctx); | 78 | Id EmitUndefU1(EmitContext& ctx); |
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 e5e4c352b..1030404c0 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 | |||
| @@ -403,6 +403,13 @@ Id EmitIsHelperInvocation(EmitContext& ctx) { | |||
| 403 | return ctx.OpLoad(ctx.U1, ctx.is_helper_invocation); | 403 | return ctx.OpLoad(ctx.U1, ctx.is_helper_invocation); |
| 404 | } | 404 | } |
| 405 | 405 | ||
| 406 | Id EmitYDirection(EmitContext& ctx) { | ||
| 407 | if (ctx.profile.y_negate) { | ||
| 408 | return ctx.Constant(ctx.F32[1], -1.0f); | ||
| 409 | } | ||
| 410 | return ctx.Constant(ctx.F32[1], 1.0f); | ||
| 411 | } | ||
| 412 | |||
| 406 | Id EmitLoadLocal(EmitContext& ctx, Id word_offset) { | 413 | Id EmitLoadLocal(EmitContext& ctx, Id word_offset) { |
| 407 | const Id pointer{ctx.OpAccessChain(ctx.private_u32, ctx.local_memory, word_offset)}; | 414 | const Id pointer{ctx.OpAccessChain(ctx.private_u32, ctx.local_memory, word_offset)}; |
| 408 | return ctx.OpLoad(ctx.U32[1], pointer); | 415 | return ctx.OpLoad(ctx.U32[1], pointer); |