node: Throw a TypeError when writeTimestamp is not supported
Bug: None Change-Id: I7e02883c53371c40a9e1766d50550ffc43165c2e Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/112425 Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
parent
9f7c06ce14
commit
4c5a9c1ef7
|
@ -173,6 +173,12 @@ void GPUCommandEncoder::insertDebugMarker(Napi::Env, std::string markerLabel) {
|
||||||
void GPUCommandEncoder::writeTimestamp(Napi::Env env,
|
void GPUCommandEncoder::writeTimestamp(Napi::Env env,
|
||||||
interop::Interface<interop::GPUQuerySet> querySet,
|
interop::Interface<interop::GPUQuerySet> querySet,
|
||||||
interop::GPUSize32 queryIndex) {
|
interop::GPUSize32 queryIndex) {
|
||||||
|
if (!device_.HasFeature(wgpu::FeatureName::TimestampQuery)) {
|
||||||
|
Napi::TypeError::New(env, "timestamp-query feature is not enabled.")
|
||||||
|
.ThrowAsJavaScriptException();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Converter conv(env);
|
Converter conv(env);
|
||||||
|
|
||||||
wgpu::QuerySet q{};
|
wgpu::QuerySet q{};
|
||||||
|
|
Loading…
Reference in New Issue