3#include "spdlog/fmt/fmt.h"
13 std::vector<ValidationError>
validate(
void)
const override
15 std::vector<ValidationError> errors;
16 if (this->
value.format == wgpu::TextureFormat::Undefined)
18 errors.emplace_back(
"Format is not set", fmt::format(
"DepthStencilState({})", this->
name),
21 if (this->
value.depthWriteEnabled && this->value.depthCompare == wgpu::CompareFunction::Undefined)
23 errors.emplace_back(
"Depth compare function is not set while depth write is enabled",
31 this->
value.depthCompare = func;
37 this->
value.depthWriteEnabled = enabled;
43 this->
value.format = format;
47 inline const wgpu::DepthStencilState &
getValue()
const {
return this->
value; }
DepthStencilState & setDepthWriteEnabled(wgpu::OptionalBool enabled)
Definition DepthStencilState.hpp:35
wgpu::DepthStencilState value
Definition DepthStencilState.hpp:50
DepthStencilState & setCompareFunction(wgpu::CompareFunction func)
Definition DepthStencilState.hpp:29
DepthStencilState & setFormat(wgpu::TextureFormat format)
Definition DepthStencilState.hpp:41
~DepthStencilState() override=default
std::vector< ValidationError > validate(void) const override
Definition DepthStencilState.hpp:13
DepthStencilState(const std::string &name)
Definition DepthStencilState.hpp:10
std::string name
Definition DepthStencilState.hpp:51
const wgpu::DepthStencilState & getValue() const
Definition DepthStencilState.hpp:47
Definition IValidable.hpp:26
Definition DefaultSampler.hpp:6
constexpr DefaultFlag Default
Definition webgpu.hpp:78
@ Error
Definition IValidable.hpp:14