Skip to content

Commit

Permalink
GPU. Constants [generated] (#2219)
Browse files Browse the repository at this point in the history
  • Loading branch information
turansky committed Mar 2, 2024
1 parent b4c2abe commit b38363b
Show file tree
Hide file tree
Showing 18 changed files with 99 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import js.objects.JsPlainObject
@JsPlainObject
sealed external interface GPUBindGroupLayoutEntry {
var binding: Number
var visibility: GPUShaderStageFlags
var visibility: GPUShaderStage
var buffer: GPUBufferBindingLayout?
var sampler: GPUSamplerBindingLayout?
var texture: GPUTextureBindingLayout?
Expand Down
4 changes: 2 additions & 2 deletions kotlin-web/src/jsMain/generated/web/gpu/GPUBuffer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ sealed external class GPUBuffer :
GPUObjectBase {
override var label: String
val size: Number
val usage: GPUFlagsConstant
val usage: GPUConstant
val mapState: GPUBufferMapState
fun mapAsync(
mode: GPUMapModeFlags,
mode: GPUMapMode,
offset: Number = definedExternally,
size: Number = definedExternally,
): Promise<Void>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ package web.gpu
sealed external interface GPUBufferDescriptor :
GPUObjectDescriptorBase {
var size: Number
var usage: GPUBufferUsageFlags
var usage: GPUBufferUsage
var mappedAtCreation: Boolean?
}
23 changes: 23 additions & 0 deletions kotlin-web/src/jsMain/generated/web/gpu/GPUBufferUsage.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Automatically generated - do not modify!

@file:Suppress(
"NESTED_CLASS_IN_EXTERNAL_INTERFACE",
)

package web.gpu

external interface GPUBufferUsage
: GPUConstant {
companion object {
val MAP_READ: GPUBufferUsage // 0x0001
val MAP_WRITE: GPUBufferUsage // 0x0002
val COPY_SRC: GPUBufferUsage // 0x0004
val COPY_DST: GPUBufferUsage // 0x0008
val INDEX: GPUBufferUsage // 0x0010
val VERTEX: GPUBufferUsage // 0x0020
val UNIFORM: GPUBufferUsage // 0x0040
val STORAGE: GPUBufferUsage // 0x0080
val INDIRECT: GPUBufferUsage // 0x0100
val QUERY_RESOLVE: GPUBufferUsage // 0x0200
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import js.objects.JsPlainObject
sealed external interface GPUCanvasConfiguration {
var device: GPUDevice
var format: GPUTextureFormat
var usage: GPUTextureUsageFlags?
var usage: GPUTextureUsage?
var viewFormats: ReadonlyArray<GPUTextureFormat>?
var colorSpace: String /* "srgb" | "display-p3" */?
var alphaMode: GPUCanvasAlphaMode?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ import js.objects.JsPlainObject
sealed external interface GPUColorTargetState {
var format: GPUTextureFormat
var blend: GPUBlendState?
var writeMask: GPUColorWriteFlags?
var writeMask: GPUColorWrite?
}
18 changes: 18 additions & 0 deletions kotlin-web/src/jsMain/generated/web/gpu/GPUColorWrite.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Automatically generated - do not modify!

@file:Suppress(
"NESTED_CLASS_IN_EXTERNAL_INTERFACE",
)

package web.gpu

external interface GPUColorWrite
: GPUConstant {
companion object {
val RED: GPUColorWrite // 0x1
val GREEN: GPUColorWrite // 0x2
val BLUE: GPUColorWrite // 0x4
val ALPHA: GPUColorWrite // 0x8
val ALL: GPUColorWrite // 0xF
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

package web.gpu

typealias GPUColorWriteFlags = Double
sealed external interface GPUConstant
5 changes: 0 additions & 5 deletions kotlin-web/src/jsMain/generated/web/gpu/GPUFlagsConstant.kt

This file was deleted.

15 changes: 15 additions & 0 deletions kotlin-web/src/jsMain/generated/web/gpu/GPUMapMode.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Automatically generated - do not modify!

@file:Suppress(
"NESTED_CLASS_IN_EXTERNAL_INTERFACE",
)

package web.gpu

external interface GPUMapMode
: GPUConstant {
companion object {
val READ: GPUMapMode // 0x0001
val WRITE: GPUMapMode // 0x0002
}
}
5 changes: 0 additions & 5 deletions kotlin-web/src/jsMain/generated/web/gpu/GPUMapModeFlags.kt

This file was deleted.

16 changes: 16 additions & 0 deletions kotlin-web/src/jsMain/generated/web/gpu/GPUShaderStage.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Automatically generated - do not modify!

@file:Suppress(
"NESTED_CLASS_IN_EXTERNAL_INTERFACE",
)

package web.gpu

external interface GPUShaderStage
: GPUConstant {
companion object {
val VERTEX: GPUShaderStage // 0x1
val FRAGMENT: GPUShaderStage // 0x2
val COMPUTE: GPUShaderStage // 0x4
}
}

This file was deleted.

2 changes: 1 addition & 1 deletion kotlin-web/src/jsMain/generated/web/gpu/GPUTexture.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ sealed external class GPUTexture :
val sampleCount: Number
val dimension: GPUTextureDimension
val format: GPUTextureFormat
val usage: GPUFlagsConstant
val usage: GPUConstant
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ sealed external interface GPUTextureDescriptor :
var sampleCount: Number?
var dimension: GPUTextureDimension?
var format: GPUTextureFormat
var usage: GPUTextureUsageFlags
var usage: GPUTextureUsage
var viewFormats: ReadonlyArray<GPUTextureFormat>?
}
18 changes: 18 additions & 0 deletions kotlin-web/src/jsMain/generated/web/gpu/GPUTextureUsage.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Automatically generated - do not modify!

@file:Suppress(
"NESTED_CLASS_IN_EXTERNAL_INTERFACE",
)

package web.gpu

external interface GPUTextureUsage
: GPUConstant {
companion object {
val COPY_SRC: GPUTextureUsage // 0x01
val COPY_DST: GPUTextureUsage // 0x02
val TEXTURE_BINDING: GPUTextureUsage // 0x04
val STORAGE_BINDING: GPUTextureUsage // 0x08
val RENDER_ATTACHMENT: GPUTextureUsage // 0x10
}
}

This file was deleted.

0 comments on commit b38363b

Please sign in to comment.