Hash :
bb14aa4d
Author :
Date :
2024-09-19T11:17:05
WebGPU: set vertex buffers. This change actually sets the vertex attributes that are added to the render pipeline description owned by the context, as well as sets the vertex buffer in the pipeline. Bug: angleproject:359823692 Change-Id: I5e94b357a4e6eadc1bbba54965cef94f90113b4e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5789155 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
//
// Copyright 2024 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// BufferWgpu.h:
// Defines the class interface for BufferWgpu, implementing BufferImpl.
//
#ifndef LIBANGLE_RENDERER_WGPU_BUFFERWGPU_H_
#define LIBANGLE_RENDERER_WGPU_BUFFERWGPU_H_
#include "libANGLE/renderer/BufferImpl.h"
#include "libANGLE/renderer/wgpu/wgpu_helpers.h"
#include <dawn/webgpu_cpp.h>
namespace rx
{
class BufferWgpu : public BufferImpl
{
public:
BufferWgpu(const gl::BufferState &state);
~BufferWgpu() override;
angle::Result setData(const gl::Context *context,
gl::BufferBinding target,
const void *data,
size_t size,
gl::BufferUsage usage) override;
angle::Result setSubData(const gl::Context *context,
gl::BufferBinding target,
const void *data,
size_t size,
size_t offset) override;
angle::Result copySubData(const gl::Context *context,
BufferImpl *source,
GLintptr sourceOffset,
GLintptr destOffset,
GLsizeiptr size) override;
angle::Result map(const gl::Context *context, GLenum access, void **mapPtr) override;
angle::Result mapRange(const gl::Context *context,
size_t offset,
size_t length,
GLbitfield access,
void **mapPtr) override;
angle::Result unmap(const gl::Context *context, GLboolean *result) override;
angle::Result getIndexRange(const gl::Context *context,
gl::DrawElementsType type,
size_t offset,
size_t count,
bool primitiveRestartEnabled,
gl::IndexRange *outRange) override;
webgpu::BufferHelper &getBuffer() { return mBuffer; }
private:
webgpu::BufferHelper mBuffer;
};
} // namespace rx
#endif // LIBANGLE_RENDERER_WGPU_BUFFERWGPU_H_