mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Backed out 3 changesets (bug 1878308) for causing webgpu failures. CLOSED TREE
Backed out changeset 2887e360adb9 (bug 1878308) Backed out changeset c5f276e2774d (bug 1878308) Backed out changeset b3fb55591aa7 (bug 1878308)
This commit is contained in:
parent
c9013b3172
commit
4fe00e0322
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -6540,7 +6540,6 @@ dependencies = [
|
||||
name = "wgpu_bindings"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"arrayvec",
|
||||
"bincode",
|
||||
"d3d12",
|
||||
"log",
|
||||
|
@ -230,7 +230,7 @@ already_AddRefed<RenderPassEncoder> CommandEncoder::BeginRenderPass(
|
||||
return pass.forget();
|
||||
}
|
||||
|
||||
void CommandEncoder::EndComputePass(ffi::WGPURecordedComputePass& aPass) {
|
||||
void CommandEncoder::EndComputePass(ffi::WGPUComputePass& aPass) {
|
||||
if (!mBridge->IsOpen()) {
|
||||
return;
|
||||
}
|
||||
@ -240,14 +240,14 @@ void CommandEncoder::EndComputePass(ffi::WGPURecordedComputePass& aPass) {
|
||||
mBridge->SendCommandEncoderAction(mId, mParent->mId, std::move(byteBuf));
|
||||
}
|
||||
|
||||
void CommandEncoder::EndRenderPass(ffi::WGPURecordedRenderPass& aPass) {
|
||||
void CommandEncoder::EndRenderPass(ffi::WGPURenderPass& aPass) {
|
||||
if (!mBridge->IsOpen()) {
|
||||
return;
|
||||
}
|
||||
|
||||
ipc::ByteBuf byteBuf;
|
||||
ffi::wgpu_render_pass_finish(&aPass, ToFFI(&byteBuf));
|
||||
mBridge->SendRenderPass(mId, mParent->mId, std::move(byteBuf));
|
||||
mBridge->SendCommandEncoderAction(mId, mParent->mId, std::move(byteBuf));
|
||||
}
|
||||
|
||||
already_AddRefed<CommandBuffer> CommandEncoder::Finish(
|
||||
|
@ -32,7 +32,7 @@ using GPUExtent3D = RangeEnforcedUnsignedLongSequenceOrGPUExtent3DDict;
|
||||
namespace webgpu {
|
||||
namespace ffi {
|
||||
struct WGPUComputePass;
|
||||
struct WGPURecordedRenderPass;
|
||||
struct WGPURenderPass;
|
||||
struct WGPUImageDataLayout;
|
||||
struct WGPUImageCopyTexture_TextureId;
|
||||
struct WGPUExtent3d;
|
||||
@ -72,8 +72,8 @@ class CommandEncoder final : public ObjectBase, public ChildOf<Device> {
|
||||
public:
|
||||
const auto& GetDevice() const { return mParent; };
|
||||
|
||||
void EndComputePass(ffi::WGPURecordedComputePass& aPass);
|
||||
void EndRenderPass(ffi::WGPURecordedRenderPass& aPass);
|
||||
void EndComputePass(ffi::WGPUComputePass& aPass);
|
||||
void EndRenderPass(ffi::WGPURenderPass& aPass);
|
||||
|
||||
void CopyBufferToBuffer(const Buffer& aSource, BufferAddress aSourceOffset,
|
||||
const Buffer& aDestination,
|
||||
|
@ -17,13 +17,13 @@ GPU_IMPL_CYCLE_COLLECTION(ComputePassEncoder, mParent, mUsedBindGroups,
|
||||
mUsedPipelines)
|
||||
GPU_IMPL_JS_WRAP(ComputePassEncoder)
|
||||
|
||||
void ffiWGPUComputePassDeleter::operator()(ffi::WGPURecordedComputePass* raw) {
|
||||
void ffiWGPUComputePassDeleter::operator()(ffi::WGPUComputePass* raw) {
|
||||
if (raw) {
|
||||
ffi::wgpu_compute_pass_destroy(raw);
|
||||
}
|
||||
}
|
||||
|
||||
ffi::WGPURecordedComputePass* BeginComputePass(
|
||||
ffi::WGPUComputePass* BeginComputePass(
|
||||
RawId aEncoderId, const dom::GPUComputePassDescriptor& aDesc) {
|
||||
MOZ_RELEASE_ASSERT(aEncoderId);
|
||||
ffi::WGPUComputePassDescriptor desc = {};
|
||||
@ -31,7 +31,7 @@ ffi::WGPURecordedComputePass* BeginComputePass(
|
||||
webgpu::StringHelper label(aDesc.mLabel);
|
||||
desc.label = label.Get();
|
||||
|
||||
return ffi::wgpu_command_encoder_begin_compute_pass(&desc);
|
||||
return ffi::wgpu_command_encoder_begin_compute_pass(aEncoderId, &desc);
|
||||
}
|
||||
|
||||
ComputePassEncoder::ComputePassEncoder(
|
||||
@ -49,16 +49,16 @@ void ComputePassEncoder::SetBindGroup(
|
||||
const dom::Sequence<uint32_t>& aDynamicOffsets) {
|
||||
if (mValid) {
|
||||
mUsedBindGroups.AppendElement(&aBindGroup);
|
||||
ffi::wgpu_recorded_compute_pass_set_bind_group(
|
||||
mPass.get(), aSlot, aBindGroup.mId, aDynamicOffsets.Elements(),
|
||||
aDynamicOffsets.Length());
|
||||
ffi::wgpu_compute_pass_set_bind_group(mPass.get(), aSlot, aBindGroup.mId,
|
||||
aDynamicOffsets.Elements(),
|
||||
aDynamicOffsets.Length());
|
||||
}
|
||||
}
|
||||
|
||||
void ComputePassEncoder::SetPipeline(const ComputePipeline& aPipeline) {
|
||||
if (mValid) {
|
||||
mUsedPipelines.AppendElement(&aPipeline);
|
||||
ffi::wgpu_recorded_compute_pass_set_pipeline(mPass.get(), aPipeline.mId);
|
||||
ffi::wgpu_compute_pass_set_pipeline(mPass.get(), aPipeline.mId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ void ComputePassEncoder::DispatchWorkgroups(uint32_t workgroupCountX,
|
||||
uint32_t workgroupCountY,
|
||||
uint32_t workgroupCountZ) {
|
||||
if (mValid) {
|
||||
ffi::wgpu_recorded_compute_pass_dispatch_workgroups(
|
||||
ffi::wgpu_compute_pass_dispatch_workgroups(
|
||||
mPass.get(), workgroupCountX, workgroupCountY, workgroupCountZ);
|
||||
}
|
||||
}
|
||||
@ -74,7 +74,7 @@ void ComputePassEncoder::DispatchWorkgroups(uint32_t workgroupCountX,
|
||||
void ComputePassEncoder::DispatchWorkgroupsIndirect(
|
||||
const Buffer& aIndirectBuffer, uint64_t aIndirectOffset) {
|
||||
if (mValid) {
|
||||
ffi::wgpu_recorded_compute_pass_dispatch_workgroups_indirect(
|
||||
ffi::wgpu_compute_pass_dispatch_workgroups_indirect(
|
||||
mPass.get(), aIndirectBuffer.mId, aIndirectOffset);
|
||||
}
|
||||
}
|
||||
@ -82,20 +82,18 @@ void ComputePassEncoder::DispatchWorkgroupsIndirect(
|
||||
void ComputePassEncoder::PushDebugGroup(const nsAString& aString) {
|
||||
if (mValid) {
|
||||
const NS_ConvertUTF16toUTF8 utf8(aString);
|
||||
ffi::wgpu_recorded_compute_pass_push_debug_group(mPass.get(), utf8.get(),
|
||||
0);
|
||||
ffi::wgpu_compute_pass_push_debug_group(mPass.get(), utf8.get(), 0);
|
||||
}
|
||||
}
|
||||
void ComputePassEncoder::PopDebugGroup() {
|
||||
if (mValid) {
|
||||
ffi::wgpu_recorded_compute_pass_pop_debug_group(mPass.get());
|
||||
ffi::wgpu_compute_pass_pop_debug_group(mPass.get());
|
||||
}
|
||||
}
|
||||
void ComputePassEncoder::InsertDebugMarker(const nsAString& aString) {
|
||||
if (mValid) {
|
||||
const NS_ConvertUTF16toUTF8 utf8(aString);
|
||||
ffi::wgpu_recorded_compute_pass_insert_debug_marker(mPass.get(), utf8.get(),
|
||||
0);
|
||||
ffi::wgpu_compute_pass_insert_debug_marker(mPass.get(), utf8.get(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ struct GPUComputePassDescriptor;
|
||||
|
||||
namespace webgpu {
|
||||
namespace ffi {
|
||||
struct WGPURecordedComputePass;
|
||||
struct WGPUComputePass;
|
||||
} // namespace ffi
|
||||
|
||||
class BindGroup;
|
||||
@ -27,7 +27,7 @@ class CommandEncoder;
|
||||
class ComputePipeline;
|
||||
|
||||
struct ffiWGPUComputePassDeleter {
|
||||
void operator()(ffi::WGPURecordedComputePass*);
|
||||
void operator()(ffi::WGPUComputePass*);
|
||||
};
|
||||
|
||||
class ComputePassEncoder final : public ObjectBase,
|
||||
@ -43,8 +43,7 @@ class ComputePassEncoder final : public ObjectBase,
|
||||
virtual ~ComputePassEncoder();
|
||||
void Cleanup() {}
|
||||
|
||||
std::unique_ptr<ffi::WGPURecordedComputePass, ffiWGPUComputePassDeleter>
|
||||
mPass;
|
||||
std::unique_ptr<ffi::WGPUComputePass, ffiWGPUComputePassDeleter> mPass;
|
||||
// keep all the used objects alive while the pass is recorded
|
||||
nsTArray<RefPtr<const BindGroup>> mUsedBindGroups;
|
||||
nsTArray<RefPtr<const ComputePipeline>> mUsedPipelines;
|
||||
|
@ -18,7 +18,7 @@ GPU_IMPL_CYCLE_COLLECTION(RenderPassEncoder, mParent, mUsedBindGroups,
|
||||
mUsedRenderBundles)
|
||||
GPU_IMPL_JS_WRAP(RenderPassEncoder)
|
||||
|
||||
void ffiWGPURenderPassDeleter::operator()(ffi::WGPURecordedRenderPass* raw) {
|
||||
void ffiWGPURenderPassDeleter::operator()(ffi::WGPURenderPass* raw) {
|
||||
if (raw) {
|
||||
ffi::wgpu_render_pass_destroy(raw);
|
||||
}
|
||||
@ -87,7 +87,7 @@ static ffi::WGPUColor ConvertColor(
|
||||
return ffi::WGPUColor();
|
||||
}
|
||||
|
||||
ffi::WGPURecordedRenderPass* BeginRenderPass(
|
||||
ffi::WGPURenderPass* BeginRenderPass(
|
||||
CommandEncoder* const aParent, const dom::GPURenderPassDescriptor& aDesc) {
|
||||
ffi::WGPURenderPassDescriptor desc = {};
|
||||
|
||||
@ -155,7 +155,7 @@ ffi::WGPURecordedRenderPass* BeginRenderPass(
|
||||
}
|
||||
}
|
||||
|
||||
return ffi::wgpu_command_encoder_begin_render_pass(&desc);
|
||||
return ffi::wgpu_command_encoder_begin_render_pass(aParent->mId, &desc);
|
||||
}
|
||||
|
||||
RenderPassEncoder::RenderPassEncoder(CommandEncoder* const aParent,
|
||||
@ -186,16 +186,16 @@ void RenderPassEncoder::SetBindGroup(
|
||||
const dom::Sequence<uint32_t>& aDynamicOffsets) {
|
||||
if (mValid) {
|
||||
mUsedBindGroups.AppendElement(&aBindGroup);
|
||||
ffi::wgpu_recorded_render_pass_set_bind_group(
|
||||
mPass.get(), aSlot, aBindGroup.mId, aDynamicOffsets.Elements(),
|
||||
aDynamicOffsets.Length());
|
||||
ffi::wgpu_render_pass_set_bind_group(mPass.get(), aSlot, aBindGroup.mId,
|
||||
aDynamicOffsets.Elements(),
|
||||
aDynamicOffsets.Length());
|
||||
}
|
||||
}
|
||||
|
||||
void RenderPassEncoder::SetPipeline(const RenderPipeline& aPipeline) {
|
||||
if (mValid) {
|
||||
mUsedPipelines.AppendElement(&aPipeline);
|
||||
ffi::wgpu_recorded_render_pass_set_pipeline(mPass.get(), aPipeline.mId);
|
||||
ffi::wgpu_render_pass_set_pipeline(mPass.get(), aPipeline.mId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -207,8 +207,8 @@ void RenderPassEncoder::SetIndexBuffer(const Buffer& aBuffer,
|
||||
const auto iformat = aIndexFormat == dom::GPUIndexFormat::Uint32
|
||||
? ffi::WGPUIndexFormat_Uint32
|
||||
: ffi::WGPUIndexFormat_Uint16;
|
||||
ffi::wgpu_recorded_render_pass_set_index_buffer(mPass.get(), aBuffer.mId,
|
||||
iformat, aOffset, aSize);
|
||||
ffi::wgpu_render_pass_set_index_buffer(mPass.get(), aBuffer.mId, iformat,
|
||||
aOffset, aSize);
|
||||
}
|
||||
}
|
||||
|
||||
@ -216,17 +216,16 @@ void RenderPassEncoder::SetVertexBuffer(uint32_t aSlot, const Buffer& aBuffer,
|
||||
uint64_t aOffset, uint64_t aSize) {
|
||||
if (mValid) {
|
||||
mUsedBuffers.AppendElement(&aBuffer);
|
||||
ffi::wgpu_recorded_render_pass_set_vertex_buffer(
|
||||
mPass.get(), aSlot, aBuffer.mId, aOffset, aSize);
|
||||
ffi::wgpu_render_pass_set_vertex_buffer(mPass.get(), aSlot, aBuffer.mId,
|
||||
aOffset, aSize);
|
||||
}
|
||||
}
|
||||
|
||||
void RenderPassEncoder::Draw(uint32_t aVertexCount, uint32_t aInstanceCount,
|
||||
uint32_t aFirstVertex, uint32_t aFirstInstance) {
|
||||
if (mValid) {
|
||||
ffi::wgpu_recorded_render_pass_draw(mPass.get(), aVertexCount,
|
||||
aInstanceCount, aFirstVertex,
|
||||
aFirstInstance);
|
||||
ffi::wgpu_render_pass_draw(mPass.get(), aVertexCount, aInstanceCount,
|
||||
aFirstVertex, aFirstInstance);
|
||||
}
|
||||
}
|
||||
|
||||
@ -235,24 +234,24 @@ void RenderPassEncoder::DrawIndexed(uint32_t aIndexCount,
|
||||
uint32_t aFirstIndex, int32_t aBaseVertex,
|
||||
uint32_t aFirstInstance) {
|
||||
if (mValid) {
|
||||
ffi::wgpu_recorded_render_pass_draw_indexed(mPass.get(), aIndexCount,
|
||||
aInstanceCount, aFirstIndex,
|
||||
aBaseVertex, aFirstInstance);
|
||||
ffi::wgpu_render_pass_draw_indexed(mPass.get(), aIndexCount, aInstanceCount,
|
||||
aFirstIndex, aBaseVertex,
|
||||
aFirstInstance);
|
||||
}
|
||||
}
|
||||
|
||||
void RenderPassEncoder::DrawIndirect(const Buffer& aIndirectBuffer,
|
||||
uint64_t aIndirectOffset) {
|
||||
if (mValid) {
|
||||
ffi::wgpu_recorded_render_pass_draw_indirect(
|
||||
mPass.get(), aIndirectBuffer.mId, aIndirectOffset);
|
||||
ffi::wgpu_render_pass_draw_indirect(mPass.get(), aIndirectBuffer.mId,
|
||||
aIndirectOffset);
|
||||
}
|
||||
}
|
||||
|
||||
void RenderPassEncoder::DrawIndexedIndirect(const Buffer& aIndirectBuffer,
|
||||
uint64_t aIndirectOffset) {
|
||||
if (mValid) {
|
||||
ffi::wgpu_recorded_render_pass_draw_indexed_indirect(
|
||||
ffi::wgpu_render_pass_draw_indexed_indirect(
|
||||
mPass.get(), aIndirectBuffer.mId, aIndirectOffset);
|
||||
}
|
||||
}
|
||||
@ -260,16 +259,15 @@ void RenderPassEncoder::DrawIndexedIndirect(const Buffer& aIndirectBuffer,
|
||||
void RenderPassEncoder::SetViewport(float x, float y, float width, float height,
|
||||
float minDepth, float maxDepth) {
|
||||
if (mValid) {
|
||||
ffi::wgpu_recorded_render_pass_set_viewport(mPass.get(), x, y, width,
|
||||
height, minDepth, maxDepth);
|
||||
ffi::wgpu_render_pass_set_viewport(mPass.get(), x, y, width, height,
|
||||
minDepth, maxDepth);
|
||||
}
|
||||
}
|
||||
|
||||
void RenderPassEncoder::SetScissorRect(uint32_t x, uint32_t y, uint32_t width,
|
||||
uint32_t height) {
|
||||
if (mValid) {
|
||||
ffi::wgpu_recorded_render_pass_set_scissor_rect(mPass.get(), x, y, width,
|
||||
height);
|
||||
ffi::wgpu_render_pass_set_scissor_rect(mPass.get(), x, y, width, height);
|
||||
}
|
||||
}
|
||||
|
||||
@ -277,14 +275,13 @@ void RenderPassEncoder::SetBlendConstant(
|
||||
const dom::DoubleSequenceOrGPUColorDict& color) {
|
||||
if (mValid) {
|
||||
ffi::WGPUColor aColor = ConvertColor(color);
|
||||
ffi::wgpu_recorded_render_pass_set_blend_constant(mPass.get(), &aColor);
|
||||
ffi::wgpu_render_pass_set_blend_constant(mPass.get(), &aColor);
|
||||
}
|
||||
}
|
||||
|
||||
void RenderPassEncoder::SetStencilReference(uint32_t reference) {
|
||||
if (mValid) {
|
||||
ffi::wgpu_recorded_render_pass_set_stencil_reference(mPass.get(),
|
||||
reference);
|
||||
ffi::wgpu_render_pass_set_stencil_reference(mPass.get(), reference);
|
||||
}
|
||||
}
|
||||
|
||||
@ -296,27 +293,26 @@ void RenderPassEncoder::ExecuteBundles(
|
||||
mUsedRenderBundles.AppendElement(bundle);
|
||||
renderBundles.AppendElement(bundle->mId);
|
||||
}
|
||||
ffi::wgpu_recorded_render_pass_execute_bundles(
|
||||
mPass.get(), renderBundles.Elements(), renderBundles.Length());
|
||||
ffi::wgpu_render_pass_execute_bundles(mPass.get(), renderBundles.Elements(),
|
||||
renderBundles.Length());
|
||||
}
|
||||
}
|
||||
|
||||
void RenderPassEncoder::PushDebugGroup(const nsAString& aString) {
|
||||
if (mValid) {
|
||||
const NS_ConvertUTF16toUTF8 utf8(aString);
|
||||
ffi::wgpu_recorded_render_pass_push_debug_group(mPass.get(), utf8.get(), 0);
|
||||
ffi::wgpu_render_pass_push_debug_group(mPass.get(), utf8.get(), 0);
|
||||
}
|
||||
}
|
||||
void RenderPassEncoder::PopDebugGroup() {
|
||||
if (mValid) {
|
||||
ffi::wgpu_recorded_render_pass_pop_debug_group(mPass.get());
|
||||
ffi::wgpu_render_pass_pop_debug_group(mPass.get());
|
||||
}
|
||||
}
|
||||
void RenderPassEncoder::InsertDebugMarker(const nsAString& aString) {
|
||||
if (mValid) {
|
||||
const NS_ConvertUTF16toUTF8 utf8(aString);
|
||||
ffi::wgpu_recorded_render_pass_insert_debug_marker(mPass.get(), utf8.get(),
|
||||
0);
|
||||
ffi::wgpu_render_pass_insert_debug_marker(mPass.get(), utf8.get(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ class RenderPipeline;
|
||||
class TextureView;
|
||||
|
||||
struct ffiWGPURenderPassDeleter {
|
||||
void operator()(ffi::WGPURecordedRenderPass*);
|
||||
void operator()(ffi::WGPURenderPass*);
|
||||
};
|
||||
|
||||
class RenderPassEncoder final : public ObjectBase,
|
||||
@ -51,7 +51,7 @@ class RenderPassEncoder final : public ObjectBase,
|
||||
virtual ~RenderPassEncoder();
|
||||
void Cleanup() {}
|
||||
|
||||
std::unique_ptr<ffi::WGPURecordedRenderPass, ffiWGPURenderPassDeleter> mPass;
|
||||
std::unique_ptr<ffi::WGPURenderPass, ffiWGPURenderPassDeleter> mPass;
|
||||
// keep all the used objects alive while the pass is recorded
|
||||
nsTArray<RefPtr<const BindGroup>> mUsedBindGroups;
|
||||
nsTArray<RefPtr<const Buffer>> mUsedBuffers;
|
||||
|
@ -44,8 +44,6 @@ parent:
|
||||
async DeviceActionWithAck(RawId selfId, ByteBuf buf) returns (bool dummy);
|
||||
async TextureAction(RawId selfId, RawId aDeviceId, ByteBuf buf);
|
||||
async CommandEncoderAction(RawId selfId, RawId aDeviceId, ByteBuf buf);
|
||||
async RenderPass(RawId selfId, RawId aDeviceId, ByteBuf buf);
|
||||
async ComputePass(RawId selfId, RawId aDeviceId, ByteBuf buf);
|
||||
async BumpImplicitBindGroupLayout(RawId pipelineId, bool isCompute, uint32_t index, RawId assignId);
|
||||
|
||||
async DeviceCreateBuffer(RawId deviceId, RawId bufferId, GPUBufferDescriptor desc, UnsafeSharedMemoryHandle shm);
|
||||
|
@ -1341,24 +1341,6 @@ ipc::IPCResult WebGPUParent::RecvCommandEncoderAction(
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
ipc::IPCResult WebGPUParent::RecvRenderPass(RawId aEncoderId, RawId aDeviceId,
|
||||
const ipc::ByteBuf& aByteBuf) {
|
||||
ErrorBuffer error;
|
||||
ffi::wgpu_server_render_pass(mContext.get(), aEncoderId, ToFFI(&aByteBuf),
|
||||
error.ToFFI());
|
||||
ForwardError(aDeviceId, error);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
ipc::IPCResult WebGPUParent::RecvComputePass(RawId aEncoderId, RawId aDeviceId,
|
||||
const ipc::ByteBuf& aByteBuf) {
|
||||
ErrorBuffer error;
|
||||
ffi::wgpu_server_compute_pass(mContext.get(), aEncoderId, ToFFI(&aByteBuf),
|
||||
error.ToFFI());
|
||||
ForwardError(aDeviceId, error);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
ipc::IPCResult WebGPUParent::RecvBumpImplicitBindGroupLayout(RawId aPipelineId,
|
||||
bool aIsCompute,
|
||||
uint32_t aIndex,
|
||||
|
@ -118,10 +118,6 @@ class WebGPUParent final : public PWebGPUParent, public SupportsWeakPtr {
|
||||
const ipc::ByteBuf& aByteBuf);
|
||||
ipc::IPCResult RecvCommandEncoderAction(RawId aEncoderId, RawId aDeviceId,
|
||||
const ipc::ByteBuf& aByteBuf);
|
||||
ipc::IPCResult RecvRenderPass(RawId aEncoderId, RawId aDeviceId,
|
||||
const ipc::ByteBuf& aByteBuf);
|
||||
ipc::IPCResult RecvComputePass(RawId aEncoderId, RawId aDeviceId,
|
||||
const ipc::ByteBuf& aByteBuf);
|
||||
ipc::IPCResult RecvBumpImplicitBindGroupLayout(RawId aPipelineId,
|
||||
bool aIsCompute,
|
||||
uint32_t aIndex,
|
||||
|
@ -68,4 +68,3 @@ parking_lot = "0.12"
|
||||
serde = "1"
|
||||
nsstring = { path = "../../xpcom/rust/nsstring" }
|
||||
static_prefs = { path = "../../modules/libpref/init/static_prefs" }
|
||||
arrayvec = "0.7"
|
||||
|
@ -769,8 +769,9 @@ pub struct ComputePassTimestampWrites<'a> {
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wgpu_command_encoder_begin_compute_pass(
|
||||
encoder_id: id::CommandEncoderId,
|
||||
desc: &ComputePassDescriptor,
|
||||
) -> *mut crate::command::RecordedComputePass {
|
||||
) -> *mut wgc::command::ComputePass {
|
||||
let &ComputePassDescriptor {
|
||||
label,
|
||||
timestamp_writes,
|
||||
@ -794,24 +795,27 @@ pub unsafe extern "C" fn wgpu_command_encoder_begin_compute_pass(
|
||||
});
|
||||
let timestamp_writes = timestamp_writes.as_ref();
|
||||
|
||||
let pass = crate::command::RecordedComputePass::new(&wgc::command::ComputePassDescriptor {
|
||||
label,
|
||||
timestamp_writes,
|
||||
});
|
||||
let pass = wgc::command::ComputePass::new(
|
||||
encoder_id,
|
||||
&wgc::command::ComputePassDescriptor {
|
||||
label,
|
||||
timestamp_writes,
|
||||
},
|
||||
);
|
||||
Box::into_raw(Box::new(pass))
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wgpu_compute_pass_finish(
|
||||
pass: *mut crate::command::RecordedComputePass,
|
||||
pass: *mut wgc::command::ComputePass,
|
||||
output: &mut ByteBuf,
|
||||
) {
|
||||
let command = Box::from_raw(pass);
|
||||
let command = Box::from_raw(pass).into_command();
|
||||
*output = make_byte_buf(&command);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wgpu_compute_pass_destroy(pass: *mut crate::command::RecordedComputePass) {
|
||||
pub unsafe extern "C" fn wgpu_compute_pass_destroy(pass: *mut wgc::command::ComputePass) {
|
||||
let _ = Box::from_raw(pass);
|
||||
}
|
||||
|
||||
@ -834,8 +838,9 @@ pub struct RenderPassTimestampWrites<'a> {
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wgpu_command_encoder_begin_render_pass(
|
||||
encoder_id: id::CommandEncoderId,
|
||||
desc: &RenderPassDescriptor,
|
||||
) -> *mut crate::command::RecordedRenderPass {
|
||||
) -> *mut wgc::command::RenderPass {
|
||||
let &RenderPassDescriptor {
|
||||
label,
|
||||
color_attachments,
|
||||
@ -868,27 +873,30 @@ pub unsafe extern "C" fn wgpu_command_encoder_begin_render_pass(
|
||||
.iter()
|
||||
.map(|format| Some(format.clone()))
|
||||
.collect();
|
||||
let pass = crate::command::RecordedRenderPass::new(&wgc::command::RenderPassDescriptor {
|
||||
label,
|
||||
color_attachments: Cow::Owned(color_attachments),
|
||||
depth_stencil_attachment: depth_stencil_attachment.as_ref(),
|
||||
timestamp_writes,
|
||||
occlusion_query_set,
|
||||
});
|
||||
let pass = wgc::command::RenderPass::new(
|
||||
encoder_id,
|
||||
&wgc::command::RenderPassDescriptor {
|
||||
label,
|
||||
color_attachments: Cow::Owned(color_attachments),
|
||||
depth_stencil_attachment: depth_stencil_attachment.as_ref(),
|
||||
timestamp_writes,
|
||||
occlusion_query_set,
|
||||
},
|
||||
);
|
||||
Box::into_raw(Box::new(pass))
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wgpu_render_pass_finish(
|
||||
pass: *mut crate::command::RecordedRenderPass,
|
||||
pass: *mut wgc::command::RenderPass,
|
||||
output: &mut ByteBuf,
|
||||
) {
|
||||
let command = Box::from_raw(pass);
|
||||
let command = Box::from_raw(pass).into_command();
|
||||
*output = make_byte_buf(&command);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wgpu_render_pass_destroy(pass: *mut crate::command::RecordedRenderPass) {
|
||||
pub unsafe extern "C" fn wgpu_render_pass_destroy(pass: *mut wgc::command::RenderPass) {
|
||||
let _ = Box::from_raw(pass);
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -8,7 +8,6 @@ use wgc::id;
|
||||
pub use wgc::command::{compute_ffi::*, render_ffi::*};
|
||||
|
||||
pub mod client;
|
||||
pub mod command;
|
||||
pub mod error;
|
||||
pub mod server;
|
||||
|
||||
|
@ -395,9 +395,7 @@ pub extern "C" fn wgpu_server_device_create_shader_module(
|
||||
if let Some(err) = error {
|
||||
out_message.set_error(&err, &source_str[..]);
|
||||
let err_type = match &err {
|
||||
CreateShaderModuleError::Device(DeviceError::OutOfMemory) => {
|
||||
ErrorBufferType::OutOfMemory
|
||||
}
|
||||
CreateShaderModuleError::Device(DeviceError::OutOfMemory) => ErrorBufferType::OutOfMemory,
|
||||
CreateShaderModuleError::Device(DeviceError::Lost) => ErrorBufferType::DeviceLost,
|
||||
_ => ErrorBufferType::Validation,
|
||||
};
|
||||
@ -567,10 +565,9 @@ pub extern "C" fn wgpu_server_get_device_fence_handle(
|
||||
if device_id.backend() == wgt::Backend::Dx12 {
|
||||
let mut handle = ptr::null_mut();
|
||||
let dx12_device = unsafe {
|
||||
global.device_as_hal::<wgc::api::Dx12, _, Option<d3d12::Device>>(
|
||||
device_id,
|
||||
|hal_device| hal_device.map(|device| device.raw_device().clone()),
|
||||
)
|
||||
global.device_as_hal::<wgc::api::Dx12, _, Option<d3d12::Device>>(device_id, |hal_device| {
|
||||
hal_device.map(|device| device.raw_device().clone())
|
||||
})
|
||||
};
|
||||
let dx12_device = match dx12_device {
|
||||
Some(device) => device,
|
||||
@ -580,10 +577,9 @@ pub extern "C" fn wgpu_server_get_device_fence_handle(
|
||||
};
|
||||
|
||||
let dx12_fence = unsafe {
|
||||
global.device_fence_as_hal::<wgc::api::Dx12, _, Option<d3d12::Fence>>(
|
||||
device_id,
|
||||
|hal_fence| hal_fence.map(|fence| fence.raw_fence().clone()),
|
||||
)
|
||||
global.device_fence_as_hal::<wgc::api::Dx12, _, Option<d3d12::Fence>>(device_id, |hal_fence| {
|
||||
hal_fence.map(|fence| fence.raw_fence().clone())
|
||||
})
|
||||
};
|
||||
let dx12_fence = match dx12_fence {
|
||||
Some(fence) => fence,
|
||||
@ -1042,32 +1038,6 @@ pub unsafe extern "C" fn wgpu_server_command_encoder_action(
|
||||
gfx_select!(self_id => global.command_encoder_action(self_id, action, error_buf));
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wgpu_server_render_pass(
|
||||
global: &Global,
|
||||
encoder_id: id::CommandEncoderId,
|
||||
byte_buf: &ByteBuf,
|
||||
error_buf: ErrorBuffer,
|
||||
) {
|
||||
let pass = bincode::deserialize(byte_buf.as_slice()).unwrap();
|
||||
let action = crate::command::replay_render_pass(encoder_id, &pass).into_command();
|
||||
|
||||
gfx_select!(encoder_id => global.command_encoder_action(encoder_id, action, error_buf));
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wgpu_server_compute_pass(
|
||||
global: &Global,
|
||||
encoder_id: id::CommandEncoderId,
|
||||
byte_buf: &ByteBuf,
|
||||
error_buf: ErrorBuffer,
|
||||
) {
|
||||
let pass = bincode::deserialize(byte_buf.as_slice()).unwrap();
|
||||
let action = crate::command::replay_compute_pass(encoder_id, &pass).into_command();
|
||||
|
||||
gfx_select!(encoder_id => global.command_encoder_action(encoder_id, action, error_buf));
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wgpu_server_device_create_encoder(
|
||||
global: &Global,
|
||||
|
Loading…
Reference in New Issue
Block a user