mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Implement GPUCommandEncoder.copy commands
This commit is contained in:
parent
132d8b4601
commit
5285c07f1f
6 changed files with 289 additions and 99 deletions
|
@ -81,6 +81,24 @@ pub enum WebGPURequest {
|
|||
destination_offset: wgt::BufferAddress,
|
||||
size: wgt::BufferAddress,
|
||||
},
|
||||
CopyBufferToTexture {
|
||||
command_encoder_id: id::CommandEncoderId,
|
||||
source: BufferCopyView,
|
||||
destination: TextureCopyView,
|
||||
copy_size: wgt::Extent3d,
|
||||
},
|
||||
CopyTextureToBuffer {
|
||||
command_encoder_id: id::CommandEncoderId,
|
||||
source: TextureCopyView,
|
||||
destination: BufferCopyView,
|
||||
copy_size: wgt::Extent3d,
|
||||
},
|
||||
CopyTextureToTexture {
|
||||
command_encoder_id: id::CommandEncoderId,
|
||||
source: TextureCopyView,
|
||||
destination: TextureCopyView,
|
||||
copy_size: wgt::Extent3d,
|
||||
},
|
||||
CreateBindGroup {
|
||||
device_id: id::DeviceId,
|
||||
// TODO: Consider using NonZeroU64 to reduce enum size
|
||||
|
@ -454,6 +472,48 @@ impl<'a> WGPU<'a> {
|
|||
size
|
||||
));
|
||||
},
|
||||
WebGPURequest::CopyBufferToTexture {
|
||||
command_encoder_id,
|
||||
source,
|
||||
destination,
|
||||
copy_size,
|
||||
} => {
|
||||
let global = &self.global;
|
||||
let _ = gfx_select!(command_encoder_id => global.command_encoder_copy_buffer_to_texture(
|
||||
command_encoder_id,
|
||||
&source,
|
||||
&destination,
|
||||
©_size
|
||||
));
|
||||
},
|
||||
WebGPURequest::CopyTextureToBuffer {
|
||||
command_encoder_id,
|
||||
source,
|
||||
destination,
|
||||
copy_size,
|
||||
} => {
|
||||
let global = &self.global;
|
||||
let _ = gfx_select!(command_encoder_id => global.command_encoder_copy_texture_to_buffer(
|
||||
command_encoder_id,
|
||||
&source,
|
||||
&destination,
|
||||
©_size
|
||||
));
|
||||
},
|
||||
WebGPURequest::CopyTextureToTexture {
|
||||
command_encoder_id,
|
||||
source,
|
||||
destination,
|
||||
copy_size,
|
||||
} => {
|
||||
let global = &self.global;
|
||||
let _ = gfx_select!(command_encoder_id => global.command_encoder_copy_texture_to_texture(
|
||||
command_encoder_id,
|
||||
&source,
|
||||
&destination,
|
||||
©_size
|
||||
));
|
||||
},
|
||||
WebGPURequest::CreateBindGroup {
|
||||
device_id,
|
||||
scope_id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue