Skip to content

Commit

Permalink
Updated API calls to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
cwoffenden committed Mar 5, 2024
1 parent af04696 commit 7e0dbde
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ static char const triangle_frag_wgsl[] = R"(
static WGPUShaderModule createShader(const char* const code, const char* label = nullptr) {
WGPUShaderModuleWGSLDescriptor wgsl = {};
wgsl.chain.sType = WGPUSType_ShaderModuleWGSLDescriptor;
wgsl.source = code;
wgsl.code = code;
WGPUShaderModuleDescriptor desc = {};
desc.nextInChain = reinterpret_cast<WGPUChainedStruct*>(&wgsl);
desc.label = label;
Expand Down Expand Up @@ -340,18 +340,10 @@ static bool redraw() {
colorDesc.view = backBufView;
colorDesc.loadOp = WGPULoadOp_Clear;
colorDesc.storeOp = WGPUStoreOp_Store;
#ifdef __EMSCRIPTEN__
// Dawn has both clearValue/clearColor but only Color works; Emscripten only has Value
colorDesc.clearValue.r = 0.3f;
colorDesc.clearValue.g = 0.3f;
colorDesc.clearValue.b = 0.3f;
colorDesc.clearValue.a = 1.0f;
#else
colorDesc.clearColor.r = 0.3f;
colorDesc.clearColor.g = 0.3f;
colorDesc.clearColor.b = 0.3f;
colorDesc.clearColor.a = 1.0f;
#endif

WGPURenderPassDescriptor renderPass = {};
renderPass.colorAttachmentCount = 1;
Expand Down

0 comments on commit 7e0dbde

Please sign in to comment.