-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
webgpu update #16184
webgpu update #16184
Conversation
Interface Check ReportThis pull request does not change any public interfaces ! |
@@ -54,7 +54,7 @@ void CCWGPUBuffer::doInit(const BufferInfo &info) { | |||
_gpuBufferObject->indirectObjs.resize(drawInfoCount); | |||
} | |||
|
|||
_size = ceil(info.size / 4.0) * 4; | |||
_size = ceil(info.size / 16.0) * 16; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using boost::alignment::align_up
or (size + (n - 1)) / n * n
to avoid double
conversion, which might introduce precision problem.
@@ -446,7 +437,7 @@ void CCWGPUCommandBuffer::bindStates() { | |||
if (indexBuffer) { | |||
wgpuRenderPassEncoderSetIndexBuffer(_gpuCommandBufferObj->wgpuRenderPassEncoder, | |||
indexBuffer->gpuBufferObject()->wgpuBuffer, | |||
indexBuffer->getStride() == 2 ? WGPUIndexFormat::WGPUIndexFormat_Uint16 : WGPUIndexFormat_Uint32, | |||
indexBuffer->getStride() <= 2 ? WGPUIndexFormat::WGPUIndexFormat_Uint16 : WGPUIndexFormat_Uint32, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might assert(indexBuffer->getStride() >= 2)
. I am not sure whether we can handle stride < 2
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I think I must have met uint8 array as an index buffer, shall we make all index buffer a u16array or a u32array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. We can only use u16array
or u32array
, if it is possible.
Re: # cocos/cocos-engine-external#417
Changelog
webgpu update:
Continuous Integration
This pull request:
Compatibility Check
This pull request: