Coverage Report

Created: 2026-06-08 06:54

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/spirv-tools/source/opt/interp_fixup_pass.h
Line
Count
Source
1
// Copyright (c) 2021 The Khronos Group Inc.
2
// Copyright (c) 2021 Valve Corporation
3
// Copyright (c) 2021 LunarG Inc.
4
//
5
// Licensed under the Apache License, Version 2.0 (the "License");
6
// you may not use this file except in compliance with the License.
7
// You may obtain a copy of the License at
8
//
9
//     http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing, software
12
// distributed under the License is distributed on an "AS IS" BASIS,
13
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
// See the License for the specific language governing permissions and
15
// limitations under the License.
16
17
#ifndef SOURCE_OPT_INTERP_FIXUP_H
18
#define SOURCE_OPT_INTERP_FIXUP_H
19
20
#include "source/opt/ir_context.h"
21
#include "source/opt/module.h"
22
#include "source/opt/pass.h"
23
24
namespace spvtools {
25
namespace opt {
26
27
// Replaces overloaded internal form for GLSLstd450Interpolate* instructions
28
// with external form. Specifically, removes OpLoad from the first argument
29
// and replaces it with the pointer for the OpLoad. glslang generates the
30
// internal form. This pass is called as part of glslang HLSL legalization.
31
class InterpFixupPass : public Pass {
32
 public:
33
9.01k
  const char* name() const override { return "interp-fixup"; }
34
  Status Process() override;
35
36
0
  IRContext::Analysis GetPreservedAnalyses() override {
37
0
    return IRContext::kAnalysisInstrToBlockMapping |
38
0
           IRContext::kAnalysisDecorations | IRContext::kAnalysisCombinators |
39
0
           IRContext::kAnalysisCFG | IRContext::kAnalysisDominatorAnalysis |
40
0
           IRContext::kAnalysisLoopAnalysis | IRContext::kAnalysisNameMap |
41
0
           IRContext::kAnalysisScalarEvolution |
42
0
           IRContext::kAnalysisRegisterPressure |
43
0
           IRContext::kAnalysisValueNumberTable |
44
0
           IRContext::kAnalysisStructuredCFG |
45
0
           IRContext::kAnalysisBuiltinVarId |
46
0
           IRContext::kAnalysisIdToFuncMapping | IRContext::kAnalysisTypes |
47
0
           IRContext::kAnalysisDefUse | IRContext::kAnalysisConstants;
48
0
  }
49
};
50
51
}  // namespace opt
52
}  // namespace spvtools
53
54
#endif  // SOURCE_OPT_INTERP_FIXUP_H