载入中...
搜索中...
未找到
GraphicsShaderReload.cpp
浏览该文件的文档.
21 if (candidate.swapchainOpaquePipeline) device->destroyPipeline(candidate.swapchainOpaquePipeline);
23 if (candidate.offscreenOpaquePipeline) device->destroyPipeline(candidate.offscreenOpaquePipeline);
25 if (candidate.hdrOffscreenOpaquePipeline) device->destroyPipeline(candidate.hdrOffscreenOpaquePipeline);
27 if (candidate.mesh3dOffscreenPipeline) device->destroyPipeline(candidate.mesh3dOffscreenPipeline);
28 if (candidate.mesh3dHdrOffscreenPipeline) device->destroyPipeline(candidate.mesh3dHdrOffscreenPipeline);
42 return Result<void>::failure(Diagnostic::error(DiagnosticCode::StaleHandle, "shader is not a live resource owned by this Graphics instance", "shader", {},
45 return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, "fragment SPIR-V must not be empty", "fragSpv", {},
49 return Result<void>::failure(Diagnostic::error(DiagnosticCode::ParseError, "SPIR-V magic mismatch", "source", {},
60 return Result<void>::failure(Diagnostic::error(DiagnosticCode::StaleHandle, "shader GPU resource is no longer owned by this Graphics instance", "shader.gpuHandle", {},
105 vert, fragSpv, candidate.pipelineLayout, activeScenePass(), activeSceneSamples(), shader.meshBlend,
118 return Result<void>::failure(Diagnostic::error(DiagnosticCode::Failed, std::string("failed to prepare replacement pipeline: ") + error.what(), "pipeline", {},
122 return Result<void>::failure(Diagnostic::error(DiagnosticCode::Failed, "failed to prepare replacement pipeline", "pipeline", {},
128 if (current->swapchainOpaquePipeline) device->destroyPipeline(current->swapchainOpaquePipeline);
130 if (current->offscreenOpaquePipeline) device->destroyPipeline(current->offscreenOpaquePipeline);
132 if (current->hdrOffscreenOpaquePipeline) device->destroyPipeline(current->hdrOffscreenOpaquePipeline);
136 if (current->mesh3dOffscreenPipeline) device->destroyPipeline(current->mesh3dOffscreenPipeline);
155 return Result<void>::failure(Diagnostic::error(DiagnosticCode::Unsupported, "WGSL shader replacement is unavailable on the Vulkan backend", "source", {},
162 return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, "fragment GLSL must not be empty", "fragGlsl", {},
169 return Result<void>::failure(Diagnostic::error(DiagnosticCode::StaleHandle, "shader is not a live resource owned by this Graphics instance", "shader", {},
173 return Result<void>::failure(Diagnostic::error(DiagnosticCode::Unsupported, "runtime GLSL replacement does not yet provide the hair vertex "
183 return Result<void>::failure(Diagnostic::error(DiagnosticCode::ParseError, error.what(), "source", {},
186 return Result<void>::failure(Diagnostic::error(DiagnosticCode::Failed, error.what(), "compiler", {},
189 return Result<void>::failure(Diagnostic::error(DiagnosticCode::Failed, "GLSL compilation failed", "compiler", {},
198 return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvariantViolation, "temporary compiled shader could not be released", "candidate", {},
Stable, structured diagnostics shared by engine modules.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
const std::vector< uint32_t > & fragmentSpirv() const
Definition Shader.h:137
@ eMesh3D
const std::vector< uint32_t > & vertexSpirv() const
Definition Shader.h:136
Shader * newShader(const std::string &vertGlsl, const std::string &fragGlsl) override
Creates a shader. @ownership Caller deletes unless documented otherwise.
Definition Graphics2D.cpp:1133
void waitForSharedGpuResources()
Block until all in-flight GPU work (all frames) has completed.
Definition Graphics.cpp:885
Result< void > replaceShaderFromWgsl(Shader &shader, const std::string &vertWgsl, const std::string &fragWgsl) override
Replace shader from wgsl.
Definition GraphicsShaderReload.cpp:153
Shader * newMeshShader(const std::string &vertGlsl, const std::string &fragGlsl) override
Creates a mesh shader. @ownership Caller deletes unless documented otherwise.
Definition Graphics2D.cpp:1272
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:34
Result< void > replaceShaderFromGlsl(Shader &shader, const std::string &vertGlsl, const std::string &fragGlsl) override
Replace shader from glsl.
Definition GraphicsShaderReload.cpp:159
Definition VulkanSequence.h:9
Result< void > validateMeshResourceShaderReload(const GpuShader &shader, std::span< const uint32_t > vertex, std::span< const uint32_t > fragment)
Validate mesh resource shader reload.
Definition GraphicsShaderResources.cpp:63
@ InvalidArgument
@ Unsupported
@ InvariantViolation
@ Failed
@ ParseError
@ StaleHandle
@ Opaque
vk::Pipeline hdrOffscreenOpaquePipeline
Definition Graphics.h:328
vk::Pipeline mesh3dPipeline
Definition Graphics.h:329
vk::Pipeline mesh3dXrayPipeline
Definition Graphics.h:330
vk::Pipeline offscreenOpaquePipeline
Definition Graphics.h:326
vk::Pipeline mesh3dHdrOffscreenPipeline
Definition Graphics.h:332
vk::PipelineLayout pipelineLayout
Definition Graphics.h:333
vk::Pipeline mesh3dOffscreenPipeline
Definition Graphics.h:331
vk::Pipeline offscreenPipeline
Definition Graphics.h:324
vk::Pipeline swapchainOpaquePipeline
Definition Graphics.h:325
vk::Pipeline swapchainPipeline
Definition Graphics.h:323
vk::Pipeline hdrOffscreenPipeline
Definition Graphics.h:327