Skip to content

Commit

Permalink
Address latest feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
beaufortfrancois committed May 22, 2024
1 parent 084f0a0 commit 6f82930
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions src/library_webgpu.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ wgpu${type}Release: (id) => WebGPU.mgr${type}.release(id),`;
DeviceLost: 2,
Unknown: 3,
},
CompositeAlphaMode: {
Opaque: 1,
},
CreatePipelineAsyncStatus: {
Success: 0,
ValidationError: 1,
Expand Down Expand Up @@ -2686,6 +2689,11 @@ var LibraryWebGPU = {
var context = WebGPU.mgrSurface.get(surfaceId);

#if ASSERTIONS
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({{{ gpu.CompositeAlphaMode.Opaque }}} === alphaMode, "TODO: Support alphaMode.");
assert({{{ gpu.PresentMode.Fifo }}} ===
{{{ gpu.makeGetU32('config', C_STRUCTS.WGPUSurfaceConfiguration.presentMode) }}});
#endif
Expand All @@ -2708,12 +2716,7 @@ var LibraryWebGPU = {
"format": WebGPU.TextureFormat[
{{{ gpu.makeGetU32('config', C_STRUCTS.WGPUSurfaceConfiguration.format) }}}],
"usage": {{{ gpu.makeGetU32('config', C_STRUCTS.WGPUSurfaceConfiguration.usage) }}},
// viewFormatCount
// viewFormats
"alphaMode": "opaque",
"width": canvasSize[0],
"height": canvasSize[1],
"presentMode": {{{ gpu.makeGetU32('config', C_STRUCTS.WGPUSurfaceConfiguration.presentMode) }}},
};
context.configure(configuration);
},
Expand Down
2 changes: 1 addition & 1 deletion test/webgpu_basic_rendering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ void run() {
.device = device,
.format = capabilities.formats[0],
.usage = wgpu::TextureUsage::RenderAttachment,
.alphaMode = wgpu::CompositeAlphaMode::Auto,
.alphaMode = wgpu::CompositeAlphaMode::Opaque,
.width = kWidth,
.height = kHeight,
.presentMode = wgpu::PresentMode::Fifo};
Expand Down

0 comments on commit 6f82930

Please sign in to comment.