diff --git a/.github/workflows/native-compile-webgpu.yml b/.github/workflows/native-compile-webgpu.yml index 8ba473b42e3..91b16e6359f 100644 --- a/.github/workflows/native-compile-webgpu.yml +++ b/.github/workflows/native-compile-webgpu.yml @@ -18,6 +18,8 @@ concurrency: jobs: compile_wgpu: + if: + (! contains(github.event.pull_request.body, '[X] does not change any runtime related code or build configuration')) name: "Emscripten" runs-on: ubuntu-latest steps: diff --git a/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.cpp b/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.cpp index 72a79fdca36..b378027fce3 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.cpp @@ -301,8 +301,8 @@ void *CCWGPUDescriptorSet::defaultBindGroup() { WGPUBindGroupEntry bufferEntry = { .binding = 0, .buffer = buffer->gpuBufferObject()->wgpuBuffer, - .size = buffer->getSize(), .offset = buffer->getOffset(), + .size = buffer->getSize(), }; WGPUBindGroupDescriptor bindGroupDesc = { diff --git a/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSetLayout.cpp b/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSetLayout.cpp index 2708ecca1cc..9b2c5aa7101 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSetLayout.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUDescriptorSetLayout.cpp @@ -190,9 +190,9 @@ void CCWGPUDescriptorSetLayout::print() const { 1) { printf("******missing %d, %d, %d, %d, %d\n", entry.binding, entry.buffer.type, entry.sampler.type, entry.texture.sampleType, entry.storageTexture.access); } - printf("%d, %d, %d\n", entry.binding, entry.visibility, entries.size()); + printf("%d, %d, %d\n", entry.binding, entry.visibility, static_cast(entries.size())); if (entry.buffer.type != WGPUBufferBindingType_Undefined) { - printf("b %d %d %d\n", entry.buffer.type, entry.buffer.hasDynamicOffset ? 1 : 0, entry.buffer.minBindingSize); + printf("b %d %d %llu\n", entry.buffer.type, entry.buffer.hasDynamicOffset ? 1 : 0, entry.buffer.minBindingSize); } if (entry.sampler.type != WGPUSamplerBindingType_Undefined) { printf("s %d\n", entry.sampler.type); diff --git a/native/cocos/renderer/gfx-wgpu/WGPUDevice.cpp b/native/cocos/renderer/gfx-wgpu/WGPUDevice.cpp index f824acbbbc9..314cbb349c0 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUDevice.cpp +++ b/native/cocos/renderer/gfx-wgpu/WGPUDevice.cpp @@ -443,6 +443,7 @@ emscripten::val CCWGPUDevice::copyTextureToBuffers(Texture *src, const BufferTex // } // // wgpuBufferRelease(buffer); // return *bufferMapData->retBuffer; + return emscripten::val::undefined(); } void CCWGPUDevice::copyTextureToBuffers(Texture *src, uint8_t *const *buffers, const BufferTextureCopy *region, uint32_t count) { diff --git a/native/cocos/renderer/gfx-wgpu/WGPUUtils.h b/native/cocos/renderer/gfx-wgpu/WGPUUtils.h index a593e062802..7232861d87a 100644 --- a/native/cocos/renderer/gfx-wgpu/WGPUUtils.h +++ b/native/cocos/renderer/gfx-wgpu/WGPUUtils.h @@ -100,7 +100,7 @@ static WGPUTextureDimension toWGPUTextureDimension(TextureType type) { case TextureType::TEX3D: return WGPUTextureDimension::WGPUTextureDimension_3D; default: - printf("unsupport type %d.", type); + printf("Unsupport type: %d\n", static_cast(type)); return WGPUTextureDimension::WGPUTextureDimension_Force32; } } @@ -119,7 +119,7 @@ static WGPUTextureViewDimension toWGPUTextureViewDimension(TextureType type) { case TextureType::TEX3D: return WGPUTextureViewDimension::WGPUTextureViewDimension_3D; default: - printf("unsupport type %d.", type); + printf("Unsupport type %d\n", static_cast(type)); return WGPUTextureViewDimension::WGPUTextureViewDimension_Undefined; } } @@ -167,7 +167,7 @@ static WGPUTextureSampleType textureSampleTypeTrait(Format format) { case Format::DEPTH: return WGPUTextureSampleType::WGPUTextureSampleType_Depth; default: - printf("unsupport texture sample type yet, github@hana-alice to fix."); + printf("Unsupport texture sample type yet, github@hana-alice to fix.\n"); return WGPUTextureSampleType::WGPUTextureSampleType_Undefined; } } @@ -292,7 +292,7 @@ static WGPUTextureFormat toWGPUTextureFormat(Format format) { case Format::BC7_SRGB: return WGPUTextureFormat::WGPUTextureFormat_BC7RGBAUnormSrgb; default: - printf("unsupport WebGPU texture format %d\n", format); + printf("Unsupport WebGPU texture format %d\n", static_cast(format)); return WGPUTextureFormat::WGPUTextureFormat_Force32; } } @@ -355,7 +355,7 @@ static WGPUCompareFunction toWGPUCompareFunction(ComparisonFunc compareFunc) { case ComparisonFunc::ALWAYS: return WGPUCompareFunction::WGPUCompareFunction_Always; default: - printf("unsupport compareFunc: %d", compareFunc); + printf("Unsupport compareFunc: %d\n", static_cast(compareFunc)); return WGPUCompareFunction::WGPUCompareFunction_Force32; } } @@ -402,7 +402,7 @@ static WGPUShaderStageFlags toWGPUShaderStageFlag(ShaderStageFlagBit flag) { } if (result == WGPUShaderStage_None) { - printf("unsupport shader stage detected"); + printf("Unsupport shader stage detected\n"); } return result; } @@ -525,7 +525,7 @@ static WGPUVertexFormat toWGPUVertexFormat(Format format) { case Format::RGBA32I: return WGPUVertexFormat_Sint32x4; default: - printf("usvf %d\n", format); + printf("usvf %d\n", static_cast(format)); return WGPUVertexFormat_Undefined; } } @@ -543,7 +543,7 @@ static WGPUPrimitiveTopology toWGPUPrimTopology(PrimitiveMode mode) { case PrimitiveMode::TRIANGLE_STRIP: return WGPUPrimitiveTopology_TriangleStrip; default: - printf("unsupport primitive topology."); + printf("Unsupport primitive topology.\n"); return WGPUPrimitiveTopology_Force32; } } @@ -594,7 +594,7 @@ static WGPUBlendFactor toWGPUBlendFactor(BlendFactor blendFactor) { case BlendFactor::ONE_MINUS_CONSTANT_COLOR: return WGPUBlendFactor::WGPUBlendFactor_OneMinusConstant; default: - printf("unsupport blend factor config %d\n", blendFactor); + printf("Unsupport blend factor config %d\n", static_cast(blendFactor)); return WGPUBlendFactor::WGPUBlendFactor_Force32; } }