mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 18:29:23 +00:00
Make dawn_native public headers and dawn_wsi use webgpu.h
BUG=dawn:22 Change-Id: I112d71323c9305fa0997d251556fe0a41dafed29 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/12701 Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
1fdcb16b69
commit
9f90c8d3ca
@@ -65,7 +65,7 @@ namespace dawn_native { namespace opengl {
|
||||
// version of OpenGL that would let us map the buffer unsynchronized.
|
||||
gl.BindBuffer(GL_ARRAY_BUFFER, mBuffer);
|
||||
void* data = gl.MapBuffer(GL_ARRAY_BUFFER, GL_READ_ONLY);
|
||||
CallMapReadCallback(serial, DAWN_BUFFER_MAP_ASYNC_STATUS_SUCCESS, data, GetSize());
|
||||
CallMapReadCallback(serial, WGPUBufferMapAsyncStatus_Success, data, GetSize());
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace dawn_native { namespace opengl {
|
||||
// version of OpenGL that would let us map the buffer unsynchronized.
|
||||
gl.BindBuffer(GL_ARRAY_BUFFER, mBuffer);
|
||||
void* data = gl.MapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY);
|
||||
CallMapWriteCallback(serial, DAWN_BUFFER_MAP_ASYNC_STATUS_SUCCESS, data, GetSize());
|
||||
CallMapWriteCallback(serial, WGPUBufferMapAsyncStatus_Success, data, GetSize());
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
@@ -42,11 +42,11 @@ namespace dawn_native { namespace opengl {
|
||||
mBackTexture, 0);
|
||||
}
|
||||
|
||||
DawnSwapChainError NativeSwapChainImpl::Configure(DawnTextureFormat format,
|
||||
DawnTextureUsage usage,
|
||||
DawnSwapChainError NativeSwapChainImpl::Configure(WGPUTextureFormat format,
|
||||
WGPUTextureUsage usage,
|
||||
uint32_t width,
|
||||
uint32_t height) {
|
||||
if (format != DAWN_TEXTURE_FORMAT_RGBA8_UNORM) {
|
||||
if (format != WGPUTextureFormat_RGBA8Unorm) {
|
||||
return "unsupported format";
|
||||
}
|
||||
ASSERT(width > 0);
|
||||
|
||||
@@ -32,8 +32,8 @@ namespace dawn_native { namespace opengl {
|
||||
~NativeSwapChainImpl();
|
||||
|
||||
void Init(DawnWSIContextGL* context);
|
||||
DawnSwapChainError Configure(DawnTextureFormat format,
|
||||
DawnTextureUsage,
|
||||
DawnSwapChainError Configure(WGPUTextureFormat format,
|
||||
WGPUTextureUsage,
|
||||
uint32_t width,
|
||||
uint32_t height);
|
||||
DawnSwapChainError GetNextTexture(DawnSwapChainNextTexture* nextTexture);
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace dawn_native { namespace opengl {
|
||||
: AdapterDiscoveryOptionsBase(BackendType::OpenGL) {
|
||||
}
|
||||
|
||||
DawnSwapChainImplementation CreateNativeSwapChainImpl(DawnDevice device,
|
||||
DawnSwapChainImplementation CreateNativeSwapChainImpl(WGPUDevice device,
|
||||
PresentCallback present,
|
||||
void* presentUserdata) {
|
||||
Device* backendDevice = reinterpret_cast<Device*>(device);
|
||||
@@ -35,15 +35,15 @@ namespace dawn_native { namespace opengl {
|
||||
DawnSwapChainImplementation impl;
|
||||
impl = CreateSwapChainImplementation(
|
||||
new NativeSwapChainImpl(backendDevice, present, presentUserdata));
|
||||
impl.textureUsage = DAWN_TEXTURE_USAGE_PRESENT;
|
||||
impl.textureUsage = WGPUTextureUsage_Present;
|
||||
|
||||
return impl;
|
||||
}
|
||||
|
||||
DawnTextureFormat GetNativeSwapChainPreferredFormat(
|
||||
WGPUTextureFormat GetNativeSwapChainPreferredFormat(
|
||||
const DawnSwapChainImplementation* swapChain) {
|
||||
NativeSwapChainImpl* impl = reinterpret_cast<NativeSwapChainImpl*>(swapChain->userData);
|
||||
return static_cast<DawnTextureFormat>(impl->GetPreferredFormat());
|
||||
return static_cast<WGPUTextureFormat>(impl->GetPreferredFormat());
|
||||
}
|
||||
|
||||
}} // namespace dawn_native::opengl
|
||||
|
||||
Reference in New Issue
Block a user