Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows DLLs missing functions. #96

Closed
ryhor-spivak opened this issue May 12, 2021 · 5 comments
Closed

Windows DLLs missing functions. #96

ryhor-spivak opened this issue May 12, 2021 · 5 comments
Labels
question Further information is requested

Comments

@ryhor-spivak
Copy link

In v0.7.0.2 some functions are missing in dll/lib, for example wgpuQueueWriteTexture, wgpuBufferDestroy and wgpuTextureDestroy.

There are wgpu_buffer_destroy and wgpu_texture_destroy in dll exports, along with some others snake_case names from previous versions like wgpu_render_pass_draw, wgpu_render_pass_draw_indexed. But there is no header for them.

@almarklein
Copy link
Collaborator

This is due the fact that the code is now generated from the webgpu headers (instead of the other way around). Not sure what the implications for the missing destroy functions are, but I assume the resources are cleaned up automatically. I think gpuQueueWriteTexture is still there, is it not?

@kvark kvark added the question Further information is requested label May 12, 2021
@ryhor-spivak
Copy link
Author

Here is a full list of exported functions.
exports.txt

For queue there are only wgpuQueueSubmit and wgpuQueueWriteBuffer. wgpuQueueOnSubmittedWorkDone and wgpuQueueWriteTexture are missing.

@ncharlton02
Copy link
Collaborator

It appears those functions haven't been ported since #85

wgpuQueueSubmit and wgpuQueueWriteBuffer are defined here:

wgpu-native/src/device.rs

Lines 287 to 309 in b405590

#[no_mangle]
pub unsafe extern "C" fn wgpuQueueSubmit(
queue: id::QueueId,
command_count: u32,
command_buffers: *const id::CommandBufferId,
) {
let command_buffer_ids = make_slice(command_buffers, command_count as usize);
gfx_select!(queue => GLOBAL.queue_submit(queue, command_buffer_ids))
.expect("Unable to submit queue")
}
#[no_mangle]
pub unsafe extern "C" fn wgpuQueueWriteBuffer(
queue: id::QueueId,
buffer: id::BufferId,
buffer_offset: u64,
data: *const u8, // TODO: Check - this might not follow the header
data_size: usize,
) {
let slice = make_slice(data, data_size);
gfx_select!(queue => GLOBAL.queue_write_buffer(queue, buffer, buffer_offset, slice))
.expect("Unable to write buffer")
}

@almarklein almarklein mentioned this issue May 15, 2021
3 tasks
@almarklein
Copy link
Collaborator

Several functions were added back in #95 and #96. These include all functions mentioned in the comments above except wgpuQueueOnSubmittedWorkDone.

@rajveermalviya
Copy link
Collaborator

#246 somewhat fixed this, now all functions present in the headers should be exported by the lib.
But still some functions are unimplemented & they will cause a panic on call.
All of them are listed in unimplemented.rs:

use crate::native;

So I think we should have a separate issues for implementing each of those functions, or group of similar functions.
Closing this in favor of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants