summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instruction.h
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instruction.h')
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instruction.h45
1 files changed, 27 insertions, 18 deletions
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instruction.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instruction.h
index 7cdfc44dd88..c962e509a37 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instruction.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instruction.h
@@ -22,7 +22,7 @@
#include <utility>
#include <vector>
-#include "NonSemanticVulkanDebugInfo100.h"
+#include "NonSemanticShaderDebugInfo100.h"
#include "OpenCLDebugInfo100.h"
#include "source/common_debug_info.h"
#include "source/latest_version_glsl_std_450_header.h"
@@ -252,11 +252,6 @@ class Instruction : public utils::IntrusiveNodeBase<Instruction> {
// Clear line-related debug instructions attached to this instruction.
void clear_dbg_line_insts() { dbg_line_insts_.clear(); }
- // Set line-related debug instructions.
- void set_dbg_line_insts(const std::vector<Instruction>& lines) {
- dbg_line_insts_ = lines;
- }
-
// Same semantics as in the base class except the list the InstructionList
// containing |pos| will now assume ownership of |this|.
// inline void MoveBefore(Instruction* pos);
@@ -306,8 +301,21 @@ class Instruction : public utils::IntrusiveNodeBase<Instruction> {
// Sets DebugScope.
inline void SetDebugScope(const DebugScope& scope);
inline const DebugScope& GetDebugScope() const { return dbg_scope_; }
+ // Add debug line inst. Renew result id if Debug[No]Line
+ void AddDebugLine(const Instruction* inst);
// Updates DebugInlinedAt of DebugScope and OpLine.
void UpdateDebugInlinedAt(uint32_t new_inlined_at);
+ // Clear line-related debug instructions attached to this instruction
+ // along with def-use entries.
+ void ClearDbgLineInsts();
+ // Return true if Shader100:Debug[No]Line
+ bool IsDebugLineInst() const;
+ // Return true if Op[No]Line or Shader100:Debug[No]Line
+ bool IsLineInst() const;
+ // Return true if OpLine or Shader100:DebugLine
+ bool IsLine() const;
+ // Return true if OpNoLine or Shader100:DebugNoLine
+ bool IsNoLine() const;
inline uint32_t GetDebugInlinedAt() const {
return dbg_scope_.GetInlinedAt();
}
@@ -552,13 +560,13 @@ class Instruction : public utils::IntrusiveNodeBase<Instruction> {
// OpenCLDebugInfo100InstructionsMax.
OpenCLDebugInfo100Instructions GetOpenCL100DebugOpcode() const;
- // Returns debug opcode of a NonSemantic.Vulkan.DebugInfo.100 instruction. If
- // it is not a NonSemantic.Vulkan.DebugInfo.100 instruction, just returns
- // NonSemanticVulkanDebugInfo100InstructionsMax.
- NonSemanticVulkanDebugInfo100Instructions GetVulkan100DebugOpcode() const;
+ // Returns debug opcode of an NonSemantic.Shader.DebugInfo.100 instruction. If
+ // it is not an NonSemantic.Shader.DebugInfo.100 instruction, just return
+ // NonSemanticShaderDebugInfo100InstructionsMax.
+ NonSemanticShaderDebugInfo100Instructions GetShader100DebugOpcode() const;
// Returns debug opcode of an OpenCL.100.DebugInfo or
- // NonSemantic.Vulkan.DebugInfo.100 instruction. Since these overlap, we
+ // NonSemantic.Shader.DebugInfo.100 instruction. Since these overlap, we
// return the OpenCLDebugInfo code
CommonDebugInfoInstructions GetCommonDebugOpcode() const;
@@ -566,10 +574,11 @@ class Instruction : public utils::IntrusiveNodeBase<Instruction> {
bool IsOpenCL100DebugInstr() const {
return GetOpenCL100DebugOpcode() != OpenCLDebugInfo100InstructionsMax;
}
- // Returns true if it is a NonSemantic.Vulkan.DebugInfo.100 instruction.
- bool IsVulkan100DebugInstr() const {
- return GetVulkan100DebugOpcode() !=
- NonSemanticVulkanDebugInfo100InstructionsMax;
+
+ // Returns true if it is an NonSemantic.Shader.DebugInfo.100 instruction.
+ bool IsShader100DebugInstr() const {
+ return GetShader100DebugOpcode() !=
+ NonSemanticShaderDebugInfo100InstructionsMax;
}
bool IsCommonDebugInstr() const {
return GetCommonDebugOpcode() != CommonDebugInfoInstructionsMax;
@@ -608,9 +617,9 @@ class Instruction : public utils::IntrusiveNodeBase<Instruction> {
uint32_t unique_id_; // Unique instruction id
// All logical operands, including result type id and result id.
OperandList operands_;
- // Opline and OpNoLine instructions preceding this instruction. Note that for
- // Instructions representing OpLine or OpNonLine itself, this field should be
- // empty.
+ // Op[No]Line or Debug[No]Line instructions preceding this instruction. Note
+ // that for Instructions representing Op[No]Line or Debug[No]Line themselves,
+ // this field should be empty.
std::vector<Instruction> dbg_line_insts_;
// DebugScope that wraps this instruction.