Skip to content

Commit

Permalink
Handle WGPU_WHOLE_SIZE in SetIndexBuffer/SetVertexBuffer (#20168)
Browse files Browse the repository at this point in the history
Fixes #20167
  • Loading branch information
kainino0x authored Aug 31, 2023
1 parent 509b4af commit a1a024f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/library_webgpu.js
Original file line number Diff line number Diff line change
Expand Up @@ -2144,6 +2144,7 @@ var LibraryWebGPU = {
wgpuRenderPassEncoderSetIndexBuffer: (passId, bufferId, format, offset, size) => {
var pass = WebGPU.mgrRenderPassEncoder.get(passId);
var buffer = WebGPU.mgrBuffer.get(bufferId);
{{{ gpu.convertSentinelToUndefined('size') }}}
pass["setIndexBuffer"](buffer, WebGPU.IndexFormat[format], offset, size);
},
wgpuRenderPassEncoderSetPipeline: (passId, pipelineId) => {
Expand All @@ -2166,6 +2167,7 @@ var LibraryWebGPU = {
wgpuRenderPassEncoderSetVertexBuffer: (passId, slot, bufferId, offset, size) => {
var pass = WebGPU.mgrRenderPassEncoder.get(passId);
var buffer = WebGPU.mgrBuffer.get(bufferId);
{{{ gpu.convertSentinelToUndefined('size') }}}
pass["setVertexBuffer"](slot, buffer, offset, size);
},

Expand Down Expand Up @@ -2272,6 +2274,7 @@ var LibraryWebGPU = {
wgpuRenderBundleEncoderSetIndexBuffer: (bundleId, bufferId, format, offset, size) => {
var pass = WebGPU.mgrRenderBundleEncoder.get(bundleId);
var buffer = WebGPU.mgrBuffer.get(bufferId);
{{{ gpu.convertSentinelToUndefined('size') }}}
pass["setIndexBuffer"](buffer, WebGPU.IndexFormat[format], offset, size);
},
wgpuRenderBundleEncoderSetPipeline: (bundleId, pipelineId) => {
Expand All @@ -2282,6 +2285,7 @@ var LibraryWebGPU = {
wgpuRenderBundleEncoderSetVertexBuffer: (bundleId, slot, bufferId, offset, size) => {
var pass = WebGPU.mgrRenderBundleEncoder.get(bundleId);
var buffer = WebGPU.mgrBuffer.get(bufferId);
{{{ gpu.convertSentinelToUndefined('size') }}}
pass["setVertexBuffer"](slot, buffer, offset, size);
},
Expand Down

0 comments on commit a1a024f

Please sign in to comment.