载入中...
搜索中...
未找到
GraphicsShaderReload.cpp
浏览该文件的文档.
22 return Result<void>::failure(Diagnostic::error(DiagnosticCode::Unsupported, "SPIR-V shader replacement is unavailable on the WebGPU backend", "source", {},
33 return Result<void>::failure(Diagnostic::error(DiagnosticCode::StaleHandle, "shader is not a live resource owned by this Graphics instance", "shader", {},
36 return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, "fragment WGSL must not be empty", "fragWgsl", {},
45 return Result<void>::failure(Diagnostic::error(DiagnosticCode::StaleHandle, "shader GPU resource is no longer owned by this Graphics instance", "shader.gpuHandle", {},
56 return Result<void>::failure(Diagnostic::error(DiagnosticCode::PreconditionViolation, "shader has no reusable default vertex WGSL", "vertWgsl", {},
87 device.PopErrorScope(wgpu::CallbackMode::AllowProcessEvents, [&](wgpu::PopErrorScopeStatus status,
89 validationError = status == wgpu::PopErrorScopeStatus::Success ? type : wgpu::ErrorType::Unknown;
103 candidate.isMesh3D ? !candidate.mesh3dPipeline || (!candidate.isHair3D && !candidate.mesh3dXrayPipeline)
124 return Result<void>::failure(Diagnostic::error(DiagnosticCode::Unsupported, "runtime GLSL replacement is unavailable on the WebGPU backend", "source", {},
Stable, structured diagnostics shared by engine modules.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
Result< void > replaceShaderFromGlsl(Shader &shader, const std::string &vertGlsl, const std::string &fragGlsl) override
Replace shader from glsl.
Definition GraphicsShaderReload.cpp:122
Result< void > replaceShaderFromSpv(Shader &shader, const std::vector< uint32_t > &vertSpv, const std::vector< uint32_t > &fragSpv) override
Replace shader from spv.
Definition GraphicsShaderReload.cpp:20
Result< void > replaceShaderFromWgsl(Shader &shader, const std::string &vertWgsl, const std::string &fragWgsl) override
Replace shader from wgsl.
Definition GraphicsShaderReload.cpp:26
@ InvalidArgument
@ PreconditionViolation
@ Unsupported
@ Failed
@ StaleHandle
A compiled shader: one WebGPU pipeline + layout. Also holds the WGSL sources so custom shaders can be...
Definition Graphics.h:177
wgpu::RenderPipeline mesh3dPipeline
Definition Graphics.h:184
wgpu::RenderPipeline swapchainPipeline
Definition Graphics.h:178
wgpu::PipelineLayout pipelineLayout
Definition Graphics.h:188
wgpu::RenderPipeline mesh3dXrayPipeline
Definition Graphics.h:185
wgpu::RenderPipeline offscreenPipeline
Definition Graphics.h:179