@@ -3667,7 +3667,7 @@ bool DeclResultIdMapper::createStageVars(StageVarDataBundle &stageVarData,
36673667 return true ;
36683668 // Negate SV_Position.y if requested
36693669 if (semanticKind == hlsl::Semantic::Kind::Position)
3670- *value = invertYIfRequested (*value, thisSemantic.loc );
3670+ *value = theEmitter. invertYIfRequested (*value, thisSemantic.loc );
36713671 storeToShaderOutputVariable (varInstr, *value, stageVarData);
36723672 }
36733673
@@ -3856,7 +3856,7 @@ bool DeclResultIdMapper::writeBackOutputStream(const NamedDecl *decl,
38563856
38573857 // Negate SV_Position.y if requested
38583858 if (semanticInfo.semantic ->GetKind () == hlsl::Semantic::Kind::Position)
3859- value = invertYIfRequested (value, loc, range);
3859+ value = theEmitter. invertYIfRequested (value, loc, range);
38603860
38613861 // Boolean stage output variables are represented as unsigned integers.
38623862 if (isBooleanStageIOVar (decl, type, semanticInfo.semantic ->GetKind (),
@@ -3906,22 +3906,6 @@ bool DeclResultIdMapper::writeBackOutputStream(const NamedDecl *decl,
39063906 return true ;
39073907}
39083908
3909- SpirvInstruction *
3910- DeclResultIdMapper::invertYIfRequested (SpirvInstruction *position,
3911- SourceLocation loc, SourceRange range) {
3912- // Negate SV_Position.y if requested
3913- if (spirvOptions.invertY ) {
3914- const auto oldY = spvBuilder.createCompositeExtract (
3915- astContext.FloatTy , position, {1 }, loc, range);
3916- const auto newY = spvBuilder.createUnaryOp (
3917- spv::Op::OpFNegate, astContext.FloatTy , oldY, loc, range);
3918- position = spvBuilder.createCompositeInsert (
3919- astContext.getExtVectorType (astContext.FloatTy , 4 ), position, {1 }, newY,
3920- loc, range);
3921- }
3922- return position;
3923- }
3924-
39253909SpirvInstruction *
39263910DeclResultIdMapper::invertWIfRequested (SpirvInstruction *position,
39273911 SourceLocation loc) {
0 commit comments