mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-13 23:26:24 +00:00
Remove Bit from TextureUsageBit and BufferUsageBit
This is to match the naming convention of WebGPU's WebIDL and webgpu.h BUG=dawn:22 Change-Id: Ia91c5a018403e6a72eb0311b5f1a072d102282a2 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10461 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
e25a3aede0
commit
9e9e29f7a6
@@ -116,10 +116,10 @@ namespace utils {
|
||||
dawn::Buffer CreateBufferFromData(const dawn::Device& device,
|
||||
const void* data,
|
||||
uint64_t size,
|
||||
dawn::BufferUsageBit usage) {
|
||||
dawn::BufferUsage usage) {
|
||||
dawn::BufferDescriptor descriptor;
|
||||
descriptor.size = size;
|
||||
descriptor.usage = usage | dawn::BufferUsageBit::CopyDst;
|
||||
descriptor.usage = usage | dawn::BufferUsage::CopyDst;
|
||||
|
||||
dawn::Buffer buffer = device.CreateBuffer(&descriptor);
|
||||
buffer.SetSubData(0, size, data);
|
||||
@@ -224,7 +224,7 @@ namespace utils {
|
||||
descriptor.sampleCount = 1;
|
||||
descriptor.format = BasicRenderPass::kDefaultColorFormat;
|
||||
descriptor.mipLevelCount = 1;
|
||||
descriptor.usage = dawn::TextureUsageBit::OutputAttachment | dawn::TextureUsageBit::CopySrc;
|
||||
descriptor.usage = dawn::TextureUsage::OutputAttachment | dawn::TextureUsage::CopySrc;
|
||||
dawn::Texture color = device.CreateTexture(&descriptor);
|
||||
|
||||
return BasicRenderPass(width, height, color);
|
||||
|
||||
@@ -36,11 +36,11 @@ namespace utils {
|
||||
dawn::Buffer CreateBufferFromData(const dawn::Device& device,
|
||||
const void* data,
|
||||
uint64_t size,
|
||||
dawn::BufferUsageBit usage);
|
||||
dawn::BufferUsage usage);
|
||||
|
||||
template <typename T>
|
||||
dawn::Buffer CreateBufferFromData(const dawn::Device& device,
|
||||
dawn::BufferUsageBit usage,
|
||||
dawn::BufferUsage usage,
|
||||
std::initializer_list<T> data) {
|
||||
return CreateBufferFromData(device, data.begin(), uint32_t(sizeof(T) * data.size()), usage);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace utils {
|
||||
}
|
||||
|
||||
DawnSwapChainError Configure(DawnTextureFormat format,
|
||||
DawnTextureUsageBit usage,
|
||||
DawnTextureUsage usage,
|
||||
uint32_t width,
|
||||
uint32_t height) {
|
||||
if (format != DAWN_TEXTURE_FORMAT_BGRA8_UNORM) {
|
||||
@@ -65,7 +65,7 @@ namespace utils {
|
||||
[mLayer setDrawableSize:size];
|
||||
|
||||
constexpr uint32_t kFramebufferOnlyTextureUsages =
|
||||
DAWN_TEXTURE_USAGE_BIT_OUTPUT_ATTACHMENT | DAWN_TEXTURE_USAGE_BIT_PRESENT;
|
||||
DAWN_TEXTURE_USAGE_OUTPUT_ATTACHMENT | DAWN_TEXTURE_USAGE_PRESENT;
|
||||
bool hasOnlyFramebufferUsages = !(usage & (~kFramebufferOnlyTextureUsages));
|
||||
if (hasOnlyFramebufferUsages) {
|
||||
[mLayer setFramebufferOnly:YES];
|
||||
|
||||
Reference in New Issue
Block a user