Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update wgpu from 0.19.4.1 to 22.1.0.5 #289

Merged
merged 3 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Changelog

## 0.10.3 (SNAPSHOT)
## 0.11.0 (SNAPSHOT)

- Update `wgpu` from `0.19.4.1` to `22.1.0.5`.

## 0.10.2

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ repositories {
kotlin {
jvm {
compilations.all {
kotlinOptions.jvmTarget = "21" // littlekt targets jvm 21 so we must target at least 17
kotlinOptions.jvmTarget = "22" // littlekt snapshot targets jvm 22
}
}
}

val littleKtVersion = "0.10.0.a9529eb-SNAPSHOT" // or whichever hash you are using
val littleKtVersion = "0.11.0.a9529eb-SNAPSHOT" // or whichever hash you are using
val kotlinCoroutinesVersion = "1.9.1" // or whatever version you are using

sourceSets {
Expand Down
9 changes: 2 additions & 7 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.plugin.KotlinJsCompilerType
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType

Expand All @@ -15,14 +16,8 @@ kotlin {
env = System.getProperty("env")
}
systemProperty("env", env ?: "dev")
jvmArgs("--enable-preview")
}
jvm {
compilations.all {
kotlinOptions.jvmTarget = "11"
compileJavaTaskProvider?.get()?.options?.compilerArgs?.add("--enable-preview")
}
}
jvm { compilerOptions { jvmTarget = JvmTarget.JVM_22 } }
js(KotlinJsCompilerType.IR) {
browser {
binaries.executable()
Expand Down
46 changes: 23 additions & 23 deletions core/src/commonMain/kotlin/com/littlekt/graphics/webgpu/enums.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ enum class PrimitiveTopology {
*
* Vertices `0 1 2 3 4 5` create four triangles `0 1 2`, `2 1 3`, `2 3 4`, and `4 3 5`.
*/
TRIANGLE_STRIP
TRIANGLE_STRIP,
}

/** Vertex winding order which classifies the "front" face of a triangle. */
Expand All @@ -50,7 +50,7 @@ enum class FrontFace {
*
* This is the default with left-handed coordinate spaces.
*/
CW
CW,
}

/** Face of a vertex. */
Expand All @@ -62,7 +62,7 @@ enum class CullMode {
FRONT,

/** Back face. */
BACK
BACK,
}

/**
Expand Down Expand Up @@ -114,7 +114,7 @@ enum class TextureViewDimension {
CUBE_ARRAY,

/** A three-dimensional texture. */
D3
D3,
}

/** Type of data the texture holds. */
Expand All @@ -126,7 +126,7 @@ enum class TextureAspect {
STENCIL_ONLY,

/** Depth only. */
DEPTH_ONLY
DEPTH_ONLY,
}

/** Dimensionality of a texture. */
Expand All @@ -138,7 +138,7 @@ enum class TextureDimension {
D2,

/** 3D texture. */
D3
D3,
}

/**
Expand Down Expand Up @@ -313,7 +313,7 @@ enum class BlendOperation {
MIN,

/** max(Src, Dst) */
MAX
MAX,
}

/** Operation to perform on the stencil value. */
Expand Down Expand Up @@ -341,7 +341,7 @@ enum class StencilOperation {
/** Increments stencil value by one, wrapping on overflow. */
INCREMENT_WRAP,
/** Decrements stencil value by one, wrapping on underflow. */
DECREMENT_WRAP
DECREMENT_WRAP,
}

/** Alpha blend factor. */
Expand Down Expand Up @@ -383,7 +383,7 @@ enum class BlendFactor {
CONSTANT_COLOR,

/** 1.0 - Constant */
ONE_MINUS_CONSTANT_COLOR
ONE_MINUS_CONSTANT_COLOR,
}

/** Format of indices used with pipeline. */
Expand All @@ -402,7 +402,7 @@ enum class VertexFormat(
/** The byte size of the format. */
val bytes: Int,
/** If the format uses integer or float. */
val isInt: Boolean = false
val isInt: Boolean = false,
) {
/** Two unsigned bytes. uvec2 in shaders */
UINT8x2(2, 2, true),
Expand Down Expand Up @@ -492,7 +492,7 @@ enum class VertexFormat(
SINT32x3(3, 12, true),

/** four signed ints. ivec2 in shaders */
SINT32x4(4, 16, true)
SINT32x4(4, 16, true),
}

/** Whether a vertex buffer is indexed by vertex or by instance. */
Expand All @@ -501,7 +501,7 @@ enum class VertexStepMode {
VERTEX,

/** Vertex data is advanced every instance. */
INSTANCE
INSTANCE,
}

/** Operation to perform to the output attachment at the start of a render pass. */
Expand All @@ -520,7 +520,7 @@ enum class LoadOp {
CLEAR,

/** Loads the existing value for this attachment into the render pass. */
LOAD
LOAD,
}

/** Operation to perform to the output attachment at the end of a render pass. */
Expand All @@ -538,7 +538,7 @@ enum class StoreOp {
DISCARD,

/** Stores the resulting value of the render pass for this attachment. */
STORE
STORE,
}

/** Specific type of a buffer binding. */
Expand Down Expand Up @@ -575,18 +575,18 @@ enum class BufferBindingType {
* var<storage, read> my_element: array<vec4<f32>>;
* ```
*/
READ_ONLY_STORAGE
READ_ONLY_STORAGE,
}

enum class AddressMode {
CLAMP_TO_EDGE,
REPEAT,
MIRROR_REPEAT
MIRROR_REPEAT,
}

enum class FilterMode {
NEAREST,
LINEAR
LINEAR,
}

/** Comparison function used for depth and stencil operations. */
Expand Down Expand Up @@ -620,7 +620,7 @@ enum class CompareFunction {
GREATER_EQUAL,

/** Function always passes. */
ALWAYS
ALWAYS,
}

/** Specific type of a sample in a texture binding. */
Expand Down Expand Up @@ -664,7 +664,7 @@ enum class TextureSampleType {
* var t: texture_2d<u32>;
* ```
*/
UINT
UINT,
}

/** Specific type of a sampler binding. */
Expand All @@ -683,7 +683,7 @@ enum class SamplerBindingType {
* analogous functionality in
* [OpenGL](https://www.khronos.org/opengl/wiki/Sampler_Object#Comparison_mode).
*/
COMPARISON
COMPARISON,
}

/** A color write mask. Disabled color channels will not be written to. */
Expand Down Expand Up @@ -720,7 +720,7 @@ value class ColorWriteMask(val usageFlag: Int) {
/** Specifies how the alpha channel of the texture should be handled during compositing. */
enum class AlphaMode {
/**
* Chooses either [Opaque] or [Inherit] automatically,depending on the `alphaMode` that the
* Chooses either [OPAQUE] or [INHERIT] automatically,depending on the `alphaMode` that the
* current surface can support.
*/
AUTO,
Expand Down Expand Up @@ -821,7 +821,7 @@ enum class PresentMode {
*
* This is traditionally called “Fast Vsync”
*/
MAILBOX
MAILBOX,
}

/** Status of the received surface texture. */
Expand Down Expand Up @@ -1006,5 +1006,5 @@ enum class Feature {
* (@blend_src(0) and @blend_src(1)) as inputs to a blending operation with the single color
* attachment at location 0.
*/
DUAL_SOURCE_BLENDING
DUAL_SOURCE_BLENDING,
}
14 changes: 7 additions & 7 deletions core/src/jvmMain/kotlin/com/littlekt/LwjglContext.kt
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ class LwjglContext(override val configuration: JvmConfiguration) : Context() {
GLFW.glfwDefaultWindowHints()
GLFW.glfwWindowHint(
GLFW.GLFW_VISIBLE,
GLFW.GLFW_FALSE
GLFW.GLFW_FALSE,
) // the window will stay hidden after creation
GLFW.glfwWindowHint(
GLFW.GLFW_RESIZABLE,
configuration.resizeable.glfw
configuration.resizeable.glfw,
) // the window will be resizable
GLFW.glfwWindowHint(GLFW.GLFW_MAXIMIZED, configuration.maximized.glfw)
GLFW.glfwWindowHint(GLFW.GLFW_CLIENT_API, GLFW.GLFW_NO_API) // prevent opengl
Expand All @@ -113,7 +113,7 @@ class LwjglContext(override val configuration: JvmConfiguration) : Context() {
configuration.height,
configuration.title,
MemoryUtil.NULL,
MemoryUtil.NULL
MemoryUtil.NULL,
)
if (windowHandle == MemoryUtil.NULL)
throw RuntimeException("Failed to create the GLFW window")
Expand All @@ -133,7 +133,7 @@ class LwjglContext(override val configuration: JvmConfiguration) : Context() {
GLFW.glfwSetWindowPos(
windowHandle,
configuration.windowPosX ?: ((vidmode.width() - graphics.width) / 2),
configuration.windowPosY ?: ((vidmode.height() - graphics.height) / 2)
configuration.windowPosY ?: ((vidmode.height() - graphics.height) / 2),
)

// set window icon
Expand All @@ -148,7 +148,7 @@ class LwjglContext(override val configuration: JvmConfiguration) : Context() {
pixmap.height,
ByteBuffer.allocateDirect(pixmap.pixels.capacity)
.put(pixmap.pixels.toArray())
.flip()
.flip(),
)
buffer.put(icon)
icon.free()
Expand All @@ -164,7 +164,7 @@ class LwjglContext(override val configuration: JvmConfiguration) : Context() {
pixmap.height,
ByteBuffer.allocateDirect(pixmap.pixels.capacity)
.put(pixmap.pixels.toArray())
.flip()
.flip(),
)
val buffer = GLFWImage.malloc(1)
buffer.put(icon)
Expand Down Expand Up @@ -211,7 +211,7 @@ class LwjglContext(override val configuration: JvmConfiguration) : Context() {
private fun initLogging() {
val callback =
WGPULogCallback.Function { level, message, _ ->
val messageJvm = message.getUtf8String(0)
val messageJvm = message.getString(0)
val logLevel =
when (level) {
WGPULogLevel_Error() -> Logger.Level.ERROR
Expand Down
Loading
Loading