载入中...
搜索中...
未找到
PbrVariantPlan.cpp
浏览该文件的文档.
44 if (surface.vegetationAlpha.enabled && surface.vegetationAlpha.noise) plan.fragmentFlags |= PbrFadeNoise;
54 plan.fragmentTextures = std::popcount(plan.canonicalTextureMask) + std::popcount(plan.detailTextureMask) +
70 plan.fragmentSamplers = std::uint32_t(fragmentSamplers.size()) + std::popcount(plan.fragmentFlags);
75 plan.fragmentSamplers > limits.samplersPerStage || plan.vertexTextures > limits.sampledTexturesPerStage ||
78 DiagnosticCode::Unsupported, "WebGPU PBR material exceeds per-stage texture or sampler limits"));
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< PbrVariantPlan > planPbrVariant(const PbrSurface &surface, bool environment, bool shadows, const PbrVariantLimits &limits)
Plan only resources reachable for an immutable PBR draw snapshot.
Definition PbrVariantPlan.cpp:25
Result< void > validatePbrSurface(const PbrSurface &s)
Validate finite material factors and sampler enums without changing the input.
Definition PbrGpuUniform.cpp:124
@ Unsupported
Owning material parameter snapshot; texture pointers remain borrowed. Base color/metallic/roughness c...
Definition PbrSurface.h:240
PbrVegetationMotion vegetationMotion
Definition PbrSurface.h:281
PbrVegetationExtras vegetationExtras
Definition PbrSurface.h:278
std::array< PbrTextureBinding, std::size_t(PbrTextureSlot::Count)> textures
Definition PbrSurface.h:241
PbrVegetationVertex vegetationVertex
Definition PbrSurface.h:280
PbrVegetationColors vegetationColors
Definition PbrSurface.h:279
PbrVegetationDetail vegetationDetail
Definition PbrSurface.h:277
PbrVegetationAlpha vegetationAlpha
Definition PbrSurface.h:282
std::array< PbrTextureBinding, 3 > textures
Definition PbrSurface.h:110
PbrVegetationDeformationSource source
Definition PbrSurface.h:171
Device resource limits relevant to one extended PBR shader variant.
Definition PbrVariantPlan.h:31
Stable resource-layout key and checked stage counts for a PBR snapshot.
Definition PbrVariantPlan.h:37