• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2023 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include <dawn/webgpu_cpp.h>
6 #include "gpu/command_buffer/client/webgpu_cmd_helper.h"
7 #include "gpu/command_buffer/client/webgpu_implementation.h"
8 
9 #ifndef TESTING_LIBFUZZER_FUZZERS_COMMAND_BUFFER_LPM_FUZZER_WEBGPU_SUPPORT_H_
10 #define TESTING_LIBFUZZER_FUZZERS_COMMAND_BUFFER_LPM_FUZZER_WEBGPU_SUPPORT_H_
11 
12 namespace gpu::cmdbuf::fuzzing {
13 
14 // borrowed directly from DawnWireServerFuzzer.cpp for now
15 // TODO(bookholt): do something different.
16 class DawnWireSerializerFuzzer : public dawn::wire::CommandSerializer {
17  public:
18   DawnWireSerializerFuzzer();
19   ~DawnWireSerializerFuzzer() override;
20   size_t GetMaximumAllocationSize() const override;
21   void* GetCmdSpace(size_t size) override;
22   bool Flush() override;
23 
24  private:
25   std::vector<char> buf;
26 };
27 
28 }  // namespace gpu::cmdbuf::fuzzing
29 
30 #endif  // TESTING_LIBFUZZER_FUZZERS_COMMAND_BUFFER_LPM_FUZZER_WEBGPU_SUPPORT_H_
31