Files
Toastconcern--FrameStudio/third_party/spirv-tools/source/opt/graph.h
T
ToastconcernandClaude Opus 5.5 6d0b4fcd2f v0.2.0: splats, copy/paste, faster homes, seat facing, and a full bug sweep
Frame Studio
- Gaussian splats (PLY, SPZ v2-v4), PLY vertex colours, panorama skies
- Copy, cut, paste and duplicate for objects, splats and world items
- Walkable-area rebake moved off the UI thread; viewport one frame sooner;
  refresh-locked pacing (FS_PACE=timer for the old one)
- Fixed: bundle thumbnail use-after-free crash, auto-save deleting
  environments, saves into scratch copies, edits lost on non-ASCII paths,
  unopenable manifests with inf/nan, bundle save data loss, opening a home
  marking it changed, gizmo NaN, long paths, many malformed-file crashes
- Updater verifies sha256, journals the swap and never leaves the exe missing

Frame Home
- Seats turn you to face their way
- Draw batching (Hand Tutorials up to ~20% less GPU time), cut-out EQUAL pass,
  late head-pose read before submit
- Proper queue-family hand-over to the compositor layer; layer descriptor
  generations and seqlocked slots; structural SPIR-V check
- Fixed: hangs/crashes on damaged .fenv files and shaders, render-pass
  validation error, sync hazard in the foveation smoothing pass, unverified
  update downloads, half-done installs

Tests: tests_loco/env_share/spv_check wired into CMake (FRAME_TESTS) and CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VsaXGU27gsrXjDoFtyFJP9
2026-10-25 13:15:07 -05:00

148 lines
5.4 KiB
C++

// Copyright (c) 2022-2025 Arm Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SOURCE_OPT_GRAPH_H_
#define SOURCE_OPT_GRAPH_H_
#include "source/opt/instruction.h"
namespace spvtools {
namespace opt {
struct Graph {
// Creates a graph instance declared by the given OpGraph instruction
// |def_inst|.
inline explicit Graph(std::unique_ptr<Instruction> def_inst);
explicit Graph(const Graph& f) = delete;
// Creates a clone of the graph in the given |context|
//
// The parent module will default to null and needs to be explicitly set by
// the user.
Graph* Clone(IRContext*) const;
// The OpGraph instruction that begins the definition of this graph.
Instruction& DefInst() { return *def_inst_; }
const Instruction& DefInst() const { return *def_inst_; }
// Appends an input to this graph.
inline void AddInput(std::unique_ptr<Instruction> inst);
// Appends an instruction to this graph.
inline void AddInstruction(std::unique_ptr<Instruction> inst);
// Appends an output to this graph.
inline void AddOutput(std::unique_ptr<Instruction> inst);
// Add a non-semantic instruction that succeeds this graph in the module.
// These instructions are maintained in the order they are added.
inline void AddNonSemanticInstruction(std::unique_ptr<Instruction> inst);
// Saves the given graph end instruction.
void SetGraphEnd(std::unique_ptr<Instruction> end_inst);
// Returns the given graph end instruction.
inline Instruction* EndInst() { return end_inst_.get(); }
inline const Instruction* EndInst() const { return end_inst_.get(); }
// Returns graph's id
inline uint32_t result_id() const { return def_inst_->result_id(); }
// Returns graph's return type id
inline uint32_t type_id() const { return def_inst_->type_id(); }
// Return a read-only reference to the instructions that define the body of
// the graph.
const std::vector<std::unique_ptr<Instruction>>& instructions() const {
return insts_;
}
// Return a read-only reference to the instructions that define the inputs
// of the graph.
const std::vector<std::unique_ptr<Instruction>>& inputs() const {
return inputs_;
}
// Return a read-only reference to the instructions that define the outputs
// of the graph.
const std::vector<std::unique_ptr<Instruction>>& outputs() const {
return outputs_;
}
// Runs the given function |f| on instructions in this graph, in order,
// and optionally on debug line instructions that might precede them and
// non-semantic instructions that succeed the graph.
void ForEachInst(const std::function<void(Instruction*)>& f,
bool run_on_debug_line_insts = false,
bool run_on_non_semantic_insts = false);
void ForEachInst(const std::function<void(const Instruction*)>& f,
bool run_on_debug_line_insts = false,
bool run_on_non_semantic_insts = false) const;
// Runs the given function |f| on instructions in this graph, in order,
// and optionally on debug line instructions that might precede them and
// non-semantic instructions that succeed the graph. Terminates early if |f|
// returns false. Returns true if all invocations of |f| returned true;
// otherwise returns false.
bool WhileEachInst(const std::function<bool(Instruction*)>& f,
bool run_on_debug_line_insts = false,
bool run_on_non_semantic_insts = false);
bool WhileEachInst(const std::function<bool(const Instruction*)>& f,
bool run_on_debug_line_insts = false,
bool run_on_non_semantic_insts = false) const;
private:
// The OpGraph instruction that begins the definition of this graph.
std::unique_ptr<Instruction> def_inst_;
// All inputs to this graph.
std::vector<std::unique_ptr<Instruction>> inputs_;
// All instructions describing this graph
std::vector<std::unique_ptr<Instruction>> insts_;
// All outputs of this graph.
std::vector<std::unique_ptr<Instruction>> outputs_;
// The OpGraphEnd instruction.
std::unique_ptr<Instruction> end_inst_;
// Non-semantic instructions that succeed this graph.
std::vector<std::unique_ptr<Instruction>> non_semantic_;
};
inline Graph::Graph(std::unique_ptr<Instruction> def_inst)
: def_inst_(std::move(def_inst)) {}
inline void Graph::AddInput(std::unique_ptr<Instruction> inst) {
inputs_.emplace_back(std::move(inst));
}
inline void Graph::AddInstruction(std::unique_ptr<Instruction> inst) {
insts_.emplace_back(std::move(inst));
}
inline void Graph::AddOutput(std::unique_ptr<Instruction> inst) {
outputs_.emplace_back(std::move(inst));
}
inline void Graph::AddNonSemanticInstruction(
std::unique_ptr<Instruction> inst) {
non_semantic_.emplace_back(std::move(inst));
}
inline void Graph::SetGraphEnd(std::unique_ptr<Instruction> end_inst) {
end_inst_ = std::move(end_inst);
}
} // namespace opt
} // namespace spvtools
#endif // SOURCE_OPT_GRAPH_H_