Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kainino0x committed Oct 2, 2019
1 parent 49e0031 commit 3c8c196
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/library_webgpu.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,13 +450,12 @@ var LibraryWebGPU = {
frontFace: WebGPU.FrontFace[
{{{ gpu.makeGetU32('rsPtr', C_STRUCTS.DawnRasterizationStateDescriptor.frontFace) }}}],
cullMode: WebGPU.CullMode[
{{{ gpu.makeGetU32('rsPtr', C_STRUCTS.DawnRasterizationStateDescriptor.frontFace) }}}],
{{{ gpu.makeGetU32('rsPtr', C_STRUCTS.DawnRasterizationStateDescriptor.cullMode) }}}],
};
}

function makeBlendDescriptor(bdPtr) {
if (bdPtr === 0) return undefined;
{{{ gpu.makeCheck('bdPtr !== 0') }}}
return {
operation: WebGPU.BlendOperation[
{{{ gpu.makeGetU32('bdPtr', C_STRUCTS.DawnBlendDescriptor.operation) }}}],
Expand All @@ -472,10 +471,8 @@ var LibraryWebGPU = {
return {
format: WebGPU.TextureFormat[
{{{ gpu.makeGetU32('csPtr', C_STRUCTS.DawnColorStateDescriptor.format) }}}],
alphaBlend: makeBlendDescriptor(
{{{ makeGetValue('csPtr', C_STRUCTS.DawnColorStateDescriptor.alphaBlend, '*') }}}),
colorBlend: makeBlendDescriptor(
{{{ makeGetValue('csPtr', C_STRUCTS.DawnColorStateDescriptor.colorBlend, '*') }}}),
alphaBlend: makeBlendDescriptor(csPtr + {{{ C_STRUCTS.DawnColorStateDescriptor.alphaBlend }}}),
colorBlend: makeBlendDescriptor(csPtr + {{{ C_STRUCTS.DawnColorStateDescriptor.colorBlend }}}),
writeMask: {{{ gpu.makeGetU32('csPtr', C_STRUCTS.DawnColorStateDescriptor.writeMask) }}},
};
}
Expand Down

0 comments on commit 3c8c196

Please sign in to comment.