Browse Source
Merge pull request #10123 from Kelebek1/sample_mask
Define SampleMask as an array
pull/15/merge
liamwhite
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
4 additions and
2 deletions
-
src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp
-
src/shader_recompiler/backend/spirv/spirv_emit_context.cpp
|
|
@ -473,7 +473,8 @@ void EmitSetFragColor(EmitContext& ctx, u32 index, u32 component, Id value) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void EmitSetSampleMask(EmitContext& ctx, Id value) { |
|
|
void EmitSetSampleMask(EmitContext& ctx, Id value) { |
|
|
ctx.OpStore(ctx.sample_mask, value); |
|
|
|
|
|
|
|
|
const Id pointer{ctx.OpAccessChain(ctx.output_u32, ctx.sample_mask, ctx.u32_zero_value)}; |
|
|
|
|
|
ctx.OpStore(pointer, value); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void EmitSetFragDepth(EmitContext& ctx, Id value) { |
|
|
void EmitSetFragDepth(EmitContext& ctx, Id value) { |
|
|
|
|
|
@ -1572,7 +1572,8 @@ void EmitContext::DefineOutputs(const IR::Program& program) { |
|
|
Decorate(frag_depth, spv::Decoration::BuiltIn, spv::BuiltIn::FragDepth); |
|
|
Decorate(frag_depth, spv::Decoration::BuiltIn, spv::BuiltIn::FragDepth); |
|
|
} |
|
|
} |
|
|
if (info.stores_sample_mask) { |
|
|
if (info.stores_sample_mask) { |
|
|
sample_mask = DefineOutput(*this, U32[1], std::nullopt); |
|
|
|
|
|
|
|
|
const Id array_type{TypeArray(U32[1], Const(1U))}; |
|
|
|
|
|
sample_mask = DefineOutput(*this, array_type, std::nullopt); |
|
|
Decorate(sample_mask, spv::Decoration::BuiltIn, spv::BuiltIn::SampleMask); |
|
|
Decorate(sample_mask, spv::Decoration::BuiltIn, spv::BuiltIn::SampleMask); |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
|