Skip to content
Merged
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
13 changes: 8 additions & 5 deletions src/library_webgpu.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ wgpu${type}Release: (id) => WebGPU.mgr${type}.release(id),`;
CompositeAlphaMode: {
Auto: 0,
Opaque: 1,
Premultiplied: 2,
},
CreatePipelineAsyncStatus: {
Success: 0,
Expand Down Expand Up @@ -437,6 +438,11 @@ var LibraryWebGPU = {
'repeat',
'mirror-repeat',
],
AlphaMode: [
undefined, // "Auto" uses the default (which is always opaque according to the spec's IDL)
'opaque',
'premultiplied',
],
BlendFactor: [
undefined,
'zero',
Expand Down Expand Up @@ -2753,10 +2759,6 @@ var LibraryWebGPU = {
var viewFormatCount = {{{ gpu.makeGetU32('config', C_STRUCTS.WGPUSurfaceConfiguration.viewFormatCount) }}};
var viewFormats = {{{ makeGetValue('config', C_STRUCTS.WGPUSurfaceConfiguration.viewFormats, '*') }}};
assert(viewFormatCount === 0 && viewFormats === 0, "TODO: Support viewFormats.");
var alphaMode = {{{ gpu.makeGetU32('config', C_STRUCTS.WGPUSurfaceConfiguration.alphaMode) }}};
assert(alphaMode === {{{ gpu.CompositeAlphaMode.Auto }}} ||
alphaMode === {{{ gpu.CompositeAlphaMode.Opaque }}},
"TODO: Support WGPUCompositeAlphaMode_Premultiplied.");
assert({{{ gpu.PresentMode.Fifo }}} ===
{{{ gpu.makeGetU32('config', C_STRUCTS.WGPUSurfaceConfiguration.presentMode) }}});
#endif
Expand All @@ -2779,7 +2781,8 @@ var LibraryWebGPU = {
"format": WebGPU.TextureFormat[
{{{ gpu.makeGetU32('config', C_STRUCTS.WGPUSurfaceConfiguration.format) }}}],
"usage": {{{ gpu.makeGetU32('config', C_STRUCTS.WGPUSurfaceConfiguration.usage) }}},
"alphaMode": "opaque",
"alphaMode": WebGPU.AlphaMode[
{{{ gpu.makeGetU32('config', C_STRUCTS.WGPUSurfaceConfiguration.alphaMode) }}}],
};
context.configure(configuration);
},
Expand Down
Loading