Skip to content

Commit

Permalink
update js to enum casing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoreilly committed Aug 10, 2024
1 parent 89d92b3 commit 5911b90
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
11 changes: 1 addition & 10 deletions cmd/enums/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ func (e Enums) Add(t string, enum string, value int64) Enums {
return e
}

// customEnumStrings consistent with JS.
var customEnumStrings = map[string]string{
"pre-multiplied": "premultiplied",
}

func main() {
flag.Parse()

Expand Down Expand Up @@ -190,11 +185,7 @@ loop:
}
b.WriteRune(r)
}
str = b.String()
if c, ok := customEnumStrings[str]; ok {
str = c
}
fmt.Fprintf(w, "return \"%s\"\n", str)
fmt.Fprintf(w, "return \"%s\"\n", b.String())
}
if e.Name == "ErrorType" {
fmt.Fprintf(w, "default:\n")
Expand Down
2 changes: 1 addition & 1 deletion wgpu/surface_js.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type Surface struct {
func (g Surface) GetCapabilities(adapter *Adapter) (ret SurfaceCapabilities) {
// Based on https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/configure
ret.Formats = []TextureFormat{TextureFormatBGRA8Unorm, TextureFormatRGBA8Unorm, TextureFormatRGBA16Float}
ret.AlphaModes = []CompositeAlphaMode{CompositeAlphaModeOpaque, CompositeAlphaModePreMultiplied}
ret.AlphaModes = []CompositeAlphaMode{CompositeAlphaModeOpaque, CompositeAlphaModePremultiplied}
ret.PresentModes = []PresentMode{PresentModeImmediate}
return
}
Expand Down

0 comments on commit 5911b90

Please sign in to comment.