Skip to content

Commit

Permalink
[WebGPU] ShaderModule::isValid is incorrect
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=263980
rdar://117747914

Reviewed by Mike Wyrzykowski.

In 269779@main I changed ShaderModule so that m_checkedResult can also contain a
compilation failure, which allowed us to report better errors. However, it's no
longer correct to assume if the module is valid by verifying if the m_checkedResult
is monostate, as an error would also mean the module is invalid. Instead, it should
check for a successful compilation.

* Source/WebGPU/WebGPU/ShaderModule.h:
(WebGPU::ShaderModule::isValid const):

Canonical link: https://commits.webkit.org/270016@main
  • Loading branch information
tadeuzagallo committed Oct 31, 2023
1 parent 9f2abf8 commit b09b7b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/WebGPU/WebGPU/ShaderModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ShaderModule : public WGPUShaderModuleImpl, public RefCounted<ShaderModule
void getCompilationInfo(CompletionHandler<void(WGPUCompilationInfoRequestStatus, const WGPUCompilationInfo&)>&& callback);
void setLabel(String&&);

bool isValid() const { return !std::holds_alternative<std::monostate>(m_checkResult); }
bool isValid() const { return std::holds_alternative<WGSL::SuccessfulCheck>(m_checkResult); }

static WGSL::PipelineLayout convertPipelineLayout(const PipelineLayout&);
static id<MTLLibrary> createLibrary(id<MTLDevice>, const String& msl, String&& label);
Expand Down

0 comments on commit b09b7b3

Please sign in to comment.