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
@@ -38,14 +38,16 @@ void initBuffers() {
|
||||
static const uint32_t indexData[3] = {
|
||||
0, 1, 2,
|
||||
};
|
||||
indexBuffer = utils::CreateBufferFromData(device, indexData, sizeof(indexData), dawn::BufferUsageBit::Index);
|
||||
indexBuffer =
|
||||
utils::CreateBufferFromData(device, indexData, sizeof(indexData), dawn::BufferUsage::Index);
|
||||
|
||||
static const float vertexData[12] = {
|
||||
0.0f, 0.5f, 0.0f, 1.0f,
|
||||
-0.5f, -0.5f, 0.0f, 1.0f,
|
||||
0.5f, -0.5f, 0.0f, 1.0f,
|
||||
};
|
||||
vertexBuffer = utils::CreateBufferFromData(device, vertexData, sizeof(vertexData), dawn::BufferUsageBit::Vertex);
|
||||
vertexBuffer = utils::CreateBufferFromData(device, vertexData, sizeof(vertexData),
|
||||
dawn::BufferUsage::Vertex);
|
||||
}
|
||||
|
||||
void initTextures() {
|
||||
@@ -58,7 +60,7 @@ void initTextures() {
|
||||
descriptor.sampleCount = 1;
|
||||
descriptor.format = dawn::TextureFormat::RGBA8Unorm;
|
||||
descriptor.mipLevelCount = 1;
|
||||
descriptor.usage = dawn::TextureUsageBit::CopyDst | dawn::TextureUsageBit::Sampled;
|
||||
descriptor.usage = dawn::TextureUsage::CopyDst | dawn::TextureUsage::Sampled;
|
||||
texture = device.CreateTexture(&descriptor);
|
||||
|
||||
dawn::SamplerDescriptor samplerDesc = utils::GetDefaultSamplerDescriptor();
|
||||
@@ -71,7 +73,7 @@ void initTextures() {
|
||||
}
|
||||
|
||||
dawn::Buffer stagingBuffer = utils::CreateBufferFromData(
|
||||
device, data.data(), static_cast<uint32_t>(data.size()), dawn::BufferUsageBit::CopySrc);
|
||||
device, data.data(), static_cast<uint32_t>(data.size()), dawn::BufferUsage::CopySrc);
|
||||
dawn::BufferCopyView bufferCopyView = utils::CreateBufferCopyView(stagingBuffer, 0, 0, 0);
|
||||
dawn::TextureCopyView textureCopyView = utils::CreateTextureCopyView(texture, 0, 0, {0, 0, 0});
|
||||
dawn::Extent3D copySize = {1024, 1024, 1};
|
||||
@@ -88,8 +90,8 @@ void init() {
|
||||
|
||||
queue = device.CreateQueue();
|
||||
swapchain = GetSwapChain(device);
|
||||
swapchain.Configure(GetPreferredSwapChainTextureFormat(),
|
||||
dawn::TextureUsageBit::OutputAttachment, 640, 480);
|
||||
swapchain.Configure(GetPreferredSwapChainTextureFormat(), dawn::TextureUsage::OutputAttachment,
|
||||
640, 480);
|
||||
|
||||
initBuffers();
|
||||
initTextures();
|
||||
|
||||
Reference in New Issue
Block a user