Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix all warnings for gfx-webgpu and add condition control for webgpu ci yml #16232

Merged
merged 2 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/native-compile-webgpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion native/cocos/renderer/gfx-wgpu/WGPUDescriptorSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
4 changes: 2 additions & 2 deletions native/cocos/renderer/gfx-wgpu/WGPUDescriptorSetLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(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);
Expand Down
1 change: 1 addition & 0 deletions native/cocos/renderer/gfx-wgpu/WGPUDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
18 changes: 9 additions & 9 deletions native/cocos/renderer/gfx-wgpu/WGPUUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(type));
return WGPUTextureDimension::WGPUTextureDimension_Force32;
}
}
Expand All @@ -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<int>(type));
return WGPUTextureViewDimension::WGPUTextureViewDimension_Undefined;
}
}
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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<int>(format));
return WGPUTextureFormat::WGPUTextureFormat_Force32;
}
}
Expand Down Expand Up @@ -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<int>(compareFunc));
return WGPUCompareFunction::WGPUCompareFunction_Force32;
}
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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<int>(format));
return WGPUVertexFormat_Undefined;
}
}
Expand All @@ -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;
}
}
Expand Down Expand Up @@ -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<int>(blendFactor));
return WGPUBlendFactor::WGPUBlendFactor_Force32;
}
}
Expand Down
Loading