From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- dom/webgpu/RenderPassEncoder.cpp | 66 ++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'dom/webgpu/RenderPassEncoder.cpp') diff --git a/dom/webgpu/RenderPassEncoder.cpp b/dom/webgpu/RenderPassEncoder.cpp index c5cb19ce15..03c16ea3a4 100644 --- a/dom/webgpu/RenderPassEncoder.cpp +++ b/dom/webgpu/RenderPassEncoder.cpp @@ -18,7 +18,7 @@ GPU_IMPL_CYCLE_COLLECTION(RenderPassEncoder, mParent, mUsedBindGroups, mUsedRenderBundles) GPU_IMPL_JS_WRAP(RenderPassEncoder) -void ffiWGPURenderPassDeleter::operator()(ffi::WGPURenderPass* raw) { +void ffiWGPURenderPassDeleter::operator()(ffi::WGPURecordedRenderPass* raw) { if (raw) { ffi::wgpu_render_pass_destroy(raw); } @@ -30,8 +30,6 @@ static ffi::WGPULoadOp ConvertLoadOp(const dom::GPULoadOp& aOp) { return ffi::WGPULoadOp_Load; case dom::GPULoadOp::Clear: return ffi::WGPULoadOp_Clear; - case dom::GPULoadOp::EndGuard_: - break; } MOZ_CRASH("bad GPULoadOp"); } @@ -42,8 +40,6 @@ static ffi::WGPUStoreOp ConvertStoreOp(const dom::GPUStoreOp& aOp) { return ffi::WGPUStoreOp_Store; case dom::GPUStoreOp::Discard: return ffi::WGPUStoreOp_Discard; - case dom::GPUStoreOp::EndGuard_: - break; } MOZ_CRASH("bad GPUStoreOp"); } @@ -87,7 +83,7 @@ static ffi::WGPUColor ConvertColor( return ffi::WGPUColor(); } -ffi::WGPURenderPass* BeginRenderPass( +ffi::WGPURecordedRenderPass* BeginRenderPass( CommandEncoder* const aParent, const dom::GPURenderPassDescriptor& aDesc) { ffi::WGPURenderPassDescriptor desc = {}; @@ -155,7 +151,7 @@ ffi::WGPURenderPass* BeginRenderPass( } } - return ffi::wgpu_command_encoder_begin_render_pass(aParent->mId, &desc); + return ffi::wgpu_command_encoder_begin_render_pass(&desc); } RenderPassEncoder::RenderPassEncoder(CommandEncoder* const aParent, @@ -186,16 +182,16 @@ void RenderPassEncoder::SetBindGroup( const dom::Sequence& aDynamicOffsets) { if (mValid) { mUsedBindGroups.AppendElement(&aBindGroup); - ffi::wgpu_render_pass_set_bind_group(mPass.get(), aSlot, aBindGroup.mId, - aDynamicOffsets.Elements(), - aDynamicOffsets.Length()); + ffi::wgpu_recorded_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_render_pass_set_pipeline(mPass.get(), aPipeline.mId); + ffi::wgpu_recorded_render_pass_set_pipeline(mPass.get(), aPipeline.mId); } } @@ -207,8 +203,8 @@ void RenderPassEncoder::SetIndexBuffer(const Buffer& aBuffer, const auto iformat = aIndexFormat == dom::GPUIndexFormat::Uint32 ? ffi::WGPUIndexFormat_Uint32 : ffi::WGPUIndexFormat_Uint16; - ffi::wgpu_render_pass_set_index_buffer(mPass.get(), aBuffer.mId, iformat, - aOffset, aSize); + ffi::wgpu_recorded_render_pass_set_index_buffer(mPass.get(), aBuffer.mId, + iformat, aOffset, aSize); } } @@ -216,16 +212,17 @@ void RenderPassEncoder::SetVertexBuffer(uint32_t aSlot, const Buffer& aBuffer, uint64_t aOffset, uint64_t aSize) { if (mValid) { mUsedBuffers.AppendElement(&aBuffer); - ffi::wgpu_render_pass_set_vertex_buffer(mPass.get(), aSlot, aBuffer.mId, - aOffset, aSize); + ffi::wgpu_recorded_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_render_pass_draw(mPass.get(), aVertexCount, aInstanceCount, - aFirstVertex, aFirstInstance); + ffi::wgpu_recorded_render_pass_draw(mPass.get(), aVertexCount, + aInstanceCount, aFirstVertex, + aFirstInstance); } } @@ -234,24 +231,24 @@ void RenderPassEncoder::DrawIndexed(uint32_t aIndexCount, uint32_t aFirstIndex, int32_t aBaseVertex, uint32_t aFirstInstance) { if (mValid) { - ffi::wgpu_render_pass_draw_indexed(mPass.get(), aIndexCount, aInstanceCount, - aFirstIndex, aBaseVertex, - aFirstInstance); + ffi::wgpu_recorded_render_pass_draw_indexed(mPass.get(), aIndexCount, + aInstanceCount, aFirstIndex, + aBaseVertex, aFirstInstance); } } void RenderPassEncoder::DrawIndirect(const Buffer& aIndirectBuffer, uint64_t aIndirectOffset) { if (mValid) { - ffi::wgpu_render_pass_draw_indirect(mPass.get(), aIndirectBuffer.mId, - aIndirectOffset); + ffi::wgpu_recorded_render_pass_draw_indirect( + mPass.get(), aIndirectBuffer.mId, aIndirectOffset); } } void RenderPassEncoder::DrawIndexedIndirect(const Buffer& aIndirectBuffer, uint64_t aIndirectOffset) { if (mValid) { - ffi::wgpu_render_pass_draw_indexed_indirect( + ffi::wgpu_recorded_render_pass_draw_indexed_indirect( mPass.get(), aIndirectBuffer.mId, aIndirectOffset); } } @@ -259,15 +256,16 @@ 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_render_pass_set_viewport(mPass.get(), x, y, width, height, - minDepth, maxDepth); + ffi::wgpu_recorded_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_render_pass_set_scissor_rect(mPass.get(), x, y, width, height); + ffi::wgpu_recorded_render_pass_set_scissor_rect(mPass.get(), x, y, width, + height); } } @@ -275,13 +273,14 @@ void RenderPassEncoder::SetBlendConstant( const dom::DoubleSequenceOrGPUColorDict& color) { if (mValid) { ffi::WGPUColor aColor = ConvertColor(color); - ffi::wgpu_render_pass_set_blend_constant(mPass.get(), &aColor); + ffi::wgpu_recorded_render_pass_set_blend_constant(mPass.get(), &aColor); } } void RenderPassEncoder::SetStencilReference(uint32_t reference) { if (mValid) { - ffi::wgpu_render_pass_set_stencil_reference(mPass.get(), reference); + ffi::wgpu_recorded_render_pass_set_stencil_reference(mPass.get(), + reference); } } @@ -293,26 +292,27 @@ void RenderPassEncoder::ExecuteBundles( mUsedRenderBundles.AppendElement(bundle); renderBundles.AppendElement(bundle->mId); } - ffi::wgpu_render_pass_execute_bundles(mPass.get(), renderBundles.Elements(), - renderBundles.Length()); + ffi::wgpu_recorded_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_render_pass_push_debug_group(mPass.get(), utf8.get(), 0); + ffi::wgpu_recorded_render_pass_push_debug_group(mPass.get(), utf8.get(), 0); } } void RenderPassEncoder::PopDebugGroup() { if (mValid) { - ffi::wgpu_render_pass_pop_debug_group(mPass.get()); + ffi::wgpu_recorded_render_pass_pop_debug_group(mPass.get()); } } void RenderPassEncoder::InsertDebugMarker(const nsAString& aString) { if (mValid) { const NS_ConvertUTF16toUTF8 utf8(aString); - ffi::wgpu_render_pass_insert_debug_marker(mPass.get(), utf8.get(), 0); + ffi::wgpu_recorded_render_pass_insert_debug_marker(mPass.get(), utf8.get(), + 0); } } -- cgit v1.2.3