diff --git a/.travis.yml b/.travis.yml index 8df922446..2b7f58aa0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,3 +11,9 @@ before_install: # Do not run bors builds against the nightly compiler. # We want to find out about nightly bugs, so they're done in master, but we don't block on them. - if [[ $TRAVIS_RUST_VERSION == "nightly" && $TRAVIS_BRANCH == "staging" ]]; then exit; fi + +script: + - cargo test + - cargo build --manifest-path wgpu-native/Cargo.toml --features remote + - cargo build + - (cd examples && make) diff --git a/examples/hello_triangle_c/main.c b/examples/hello_triangle_c/main.c index ef451a0b4..59e81e055 100644 --- a/examples/hello_triangle_c/main.c +++ b/examples/hello_triangle_c/main.c @@ -38,5 +38,11 @@ int main() .code = read_file("./../data/hello_triangle.frag.spv"), }; WGPUShaderModuleId _fs = wgpu_device_create_shader_module(device, fs_desc); + + WGPUCommandBufferDescriptor cmd_buf_desc = { + }; + WGPUCommandBufferId cmd_buf = wgpu_device_create_command_buffer(device, cmd_buf_desc); + WGPUQueueId queue = wgpu_device_get_queue(device); + wgpu_queue_submit(queue, &cmd_buf, 1); return 0; } diff --git a/wgpu-bindings/wgpu.h b/wgpu-bindings/wgpu.h index 4c776af9e..ff5151a13 100644 --- a/wgpu-bindings/wgpu.h +++ b/wgpu-bindings/wgpu.h @@ -34,6 +34,10 @@ typedef WGPUId WGPUCommandBufferId; typedef WGPUId WGPUInstanceId; +typedef struct { + +} WGPUCommandBufferDescriptor; + typedef WGPUId WGPUShaderModuleId; typedef struct { @@ -45,19 +49,30 @@ typedef struct { WGPUByteArray code; } WGPUShaderModuleDescriptor; +typedef WGPUId WGPUQueueId; + typedef struct { WGPUPowerPreference power_preference; } WGPUAdapterDescriptor; -WGPUDeviceId wgpu_adapter_create_device(WGPUAdapterId adapter_id, WGPUDeviceDescriptor desc); +WGPUDeviceId wgpu_adapter_create_device(WGPUAdapterId adapter_id, WGPUDeviceDescriptor _desc); WGPUComputePassId wgpu_command_buffer_begin_compute_pass(void); -WGPURenderPassId wgpu_command_buffer_begin_render_pass(WGPUCommandBufferId command_buffer); +WGPURenderPassId wgpu_command_buffer_begin_render_pass(WGPUCommandBufferId _command_buffer); WGPUInstanceId wgpu_create_instance(void); +WGPUCommandBufferId wgpu_device_create_command_buffer(WGPUDeviceId device_id, + WGPUCommandBufferDescriptor desc); + WGPUShaderModuleId wgpu_device_create_shader_module(WGPUDeviceId device_id, WGPUShaderModuleDescriptor desc); +WGPUQueueId wgpu_device_get_queue(WGPUDeviceId device_id); + WGPUAdapterId wgpu_instance_get_adapter(WGPUInstanceId instance_id, WGPUAdapterDescriptor desc); + +void wgpu_queue_submit(WGPUQueueId queue_id, + const WGPUCommandBufferId *command_buffer_ptr, + uintptr_t command_buffer_count);