This is a major reworking of the way the debugger is implemented. Instead of generating shader code that is continually driving `vk::dbg` state, the debugger now: * Maintains a full shadow copy of all Intermediate values (SSA) * Only calls out to C++ whenever a trap is set * Only constructs and updates the `vk::dbg` state when a trap is hit The main goal of this reworking is to properly support OpenCL.Debug.100's DebugValue instructions that may use deref expressions (See https://www.khronos.org/registry/spir-v/specs/unified1/OpenCL.DebugInfo.100.html#_debug_operations_a_id_operation_a) These are remarkably hard to implement without having everything backed with real memory. The resulting reimplementation is: * Much, much faster (>1000x faster for sample apps I've tried). Only ~2x slower than non-debug enabled SwiftShader now. * Uses much less runtime memory. * Much cleaner, removing a load of template magic for setting variable state that was extremely hard to follow * More thoroughly commented, explaining each component and method. Bug: b/145351270 Change-Id: I1b48e9defae095109ebfaf90dfb7c7e22d335816 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/48729Reviewed-by:Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Antonio Maiorano <amaiorano@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:
Ben Clayton <bclayton@google.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| BUILD.gn | Loading commit data... | |
| CMakeLists.txt | Loading commit data... | |
| ComputeProgram.cpp | Loading commit data... | |
| ComputeProgram.hpp | Loading commit data... | |
| Constants.cpp | Loading commit data... | |
| Constants.hpp | Loading commit data... | |
| PixelProgram.cpp | Loading commit data... | |
| PixelProgram.hpp | Loading commit data... | |
| PixelRoutine.cpp | Loading commit data... | |
| PixelRoutine.hpp | Loading commit data... | |
| SamplerCore.cpp | Loading commit data... | |
| SamplerCore.hpp | Loading commit data... | |
| SetupRoutine.cpp | Loading commit data... | |
| SetupRoutine.hpp | Loading commit data... | |
| ShaderCore.cpp | Loading commit data... | |
| ShaderCore.hpp | Loading commit data... | |
| SpirvID.hpp | Loading commit data... | |
| SpirvShader.cpp | Loading commit data... | |
| SpirvShader.hpp | Loading commit data... | |
| SpirvShaderArithmetic.cpp | Loading commit data... | |
| SpirvShaderControlFlow.cpp | Loading commit data... | |
| SpirvShaderDebug.hpp | Loading commit data... | |
| SpirvShaderDebugger.cpp | Loading commit data... | |
| SpirvShaderEnumNames.cpp | Loading commit data... | |
| SpirvShaderGLSLstd450.cpp | Loading commit data... | |
| SpirvShaderGroup.cpp | Loading commit data... | |
| SpirvShaderImage.cpp | Loading commit data... | |
| SpirvShaderInstructions.cpp | Loading commit data... | |
| SpirvShaderInstructions.inl | Loading commit data... | |
| SpirvShaderMemory.cpp | Loading commit data... | |
| SpirvShaderSampling.cpp | Loading commit data... | |
| SpirvShaderSpec.cpp | Loading commit data... | |
| VertexProgram.cpp | Loading commit data... | |
| VertexProgram.hpp | Loading commit data... | |
| VertexRoutine.cpp | Loading commit data... | |
| VertexRoutine.hpp | Loading commit data... |