Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Oct 18, 2023
1 parent f332fdc commit 9602382
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,15 @@ We have a [wiki](https://github.com/gfx-rs/wgpu/wiki) that serves as a knowledge

## Supported Platforms

| API | Windows | Linux & Android | macOS & iOS | Web (wasm) |
| --------- | ------------------------------ | ------------------ | ------------------------- | ------------------------- |
| Vulkan | :white_check_mark: | :white_check_mark: | :ok: (vulkan-portability) | |
| Metal | | | :white_check_mark: | |
| DX12 | :white_check_mark: (W10+ only) | | | |
| DX11 | :hammer_and_wrench: | | | |
| GLES3 | :ok: (angle) | :ok: | :ok: (angle; macOS only) | :ok: (WebGL2 Only) |
| WebGPU | | | | :white_check_mark: |
| API | Windows | Linux & Android | macOS & iOS | Web (wasm) |
| ----------- | ------------------------------ | ------------------ | ------------------------- | ------------------------- |
| Vulkan | :white_check_mark: | :white_check_mark: | :ok: (vulkan-portability) | |
| Metal | | | :white_check_mark: | |
| DX12 | :white_check_mark: (W10+ only) | | | |
| DX11 | :hammer_and_wrench: | | | |
| GLES3 | | :ok: | :ok: (angle; macOS only) | :ok: (WebGL2 Only) |
| OpenGL 3.3+ | :ok: | | | |
| WebGPU | | | | :white_check_mark: |

:white_check_mark: = First Class Support — :ok: = Best Effort Support — :hammer_and_wrench: = Unsupported, but support in progress

Expand Down Expand Up @@ -148,6 +149,7 @@ We have multiple methods of testing, each of which tests different qualities abo
| DX11/Windows 10 | :construction: || using WARP |
| Metal/MacOS | :heavy_check_mark: || using hardware runner |
| Vulkan/Linux | :heavy_check_mark: | - | using swiftshader |
| GL/Windows | || |
| GLES/Linux | :heavy_check_mark: || using llvmpipe |
| WebGL/Chrome | :heavy_check_mark: || using swiftshader |

Expand Down
34 changes: 16 additions & 18 deletions wgpu-hal/src/gles/wgl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ fn create_global_device_context() -> Result<HDC, crate::InstanceError> {
let name = format!("wgpu Device Class {:x}\0", class_addr as usize);
let name = CString::from_vec_with_nul(name.into_bytes()).unwrap();

// Use a wrapper function for compatibility with `windows-rs`.
unsafe extern "system" fn wnd_proc(
window: HWND,
msg: UINT,
Expand Down Expand Up @@ -272,6 +273,7 @@ fn create_global_device_context() -> Result<HDC, crate::InstanceError> {
));
}

// Create a hidden window since we don't pass `WS_VISIBLE`.
let window = unsafe {
CreateWindowExA(
0,
Expand Down Expand Up @@ -361,23 +363,19 @@ impl crate::Instance<super::Api> for Instance {
&& extra.CreateContextAttribsARB.is_loaded();

let context = if can_use_profile {
let attributes = [
CONTEXT_PROFILE_MASK_ARB as c_int,
CONTEXT_CORE_PROFILE_BIT_ARB as c_int,
CONTEXT_FLAGS_ARB as c_int,
if desc.flags.contains(InstanceFlags::DEBUG) {
CONTEXT_DEBUG_BIT_ARB as c_int
} else {
0
},
0, // End of list
];
let context = unsafe {
extra.CreateContextAttribsARB(
dc as *const _,
ptr::null(),
[
CONTEXT_PROFILE_MASK_ARB as c_int,
CONTEXT_CORE_PROFILE_BIT_ARB as c_int,
CONTEXT_FLAGS_ARB as c_int,
if desc.flags.contains(InstanceFlags::DEBUG) {
CONTEXT_DEBUG_BIT_ARB as c_int
} else {
0
},
0, // End of list
]
.as_ptr(),
)
extra.CreateContextAttribsARB(dc as *const _, ptr::null(), attributes.as_ptr())
};
if context.is_null() {
return Err(crate::InstanceError::with_source(
Expand Down Expand Up @@ -563,9 +561,9 @@ impl crate::Surface<super::Api> for Surface {
let inner = &device.shared.context.inner.lock();

if let Err(e) = inner.context.make_current() {
log::error!("unable to make the shared OpengL context current: {e}",);
log::error!("unable to make the shared OpenGL context current: {e}",);
return Err(crate::SurfaceError::Other(
"unable to make the shared OpengL context current",
"unable to make the shared OpenGL context current",
));
}

Expand Down

0 comments on commit 9602382

Please sign in to comment.