Skip to content

UGpuTexture: Add - #135

Merged
Johni0702 merged 3 commits into
masterfrom
feature/ugputexture
May 18, 2026
Merged

UGpuTexture: Add#135
Johni0702 merged 3 commits into
masterfrom
feature/ugputexture

Conversation

@Johni0702

Copy link
Copy Markdown
Collaborator

This commit introduce a new UGpuTexture API to UniversalCraft.

This API mimics Mojang's Blaze3D API, but works on all versions supported by UniversalCraft.

Initially, only the most fundamental functionality is provided, together with a way to convert from/to the underlynig Minecraft type / OpenGL id. This is enough for us to start supporting Vulkan without having to lock in the API of all the more complex operations like copying between textures, updating only parts of a texture, and reading the pixel data back from gpu memory.
Most of these will likely be migrated from Essential into this new API in the future as well, just not yet with this initial commit.

This commit also adds a new UGpuSampler type, which allows one to configure texture filtering when using UC's DrawCallBuilder. This isn't directly related to the UGpuTexture API, but both changes modify the arguments of the same DrawCallBuilder.texture method, so I've combined.

This commit introduce a new `UGpuTexture` API to UniversalCraft.

This API mimics Mojang's Blaze3D API, but works on all versions
supported by UniversalCraft.

Initially, only the most fundamental functionality is provided, together
with a way to convert from/to the underlynig Minecraft type / OpenGL id.
This is enough for us to start supporting Vulkan without having to lock
in the API of all the more complex operations like copying between
textures, updating only parts of a texture, and reading the pixel data
back from gpu memory.
Most of these will likely be migrated from Essential into this new API
in the future as well, just not yet with this initial commit.

This commit also adds a new `UGpuSampler` type, which allows one to
configure texture filtering when using UC's `DrawCallBuilder`. This
isn't directly related to the `UGpuTexture` API, but both changes modify
the arguments of the same `DrawCallBuilder.texture` method, so I've
combined.
@Traben-0
Traben-0 self-requested a review May 11, 2026 10:53
Comment thread src/main/kotlin/gg/essential/universal/render/UGpuDeviceImpl.kt
Comment thread src/main/kotlin/gg/essential/universal/render/UGpuPlatformAdapterImpl.kt Outdated
Comment thread src/main/kotlin/gg/essential/universal/render/UGpuTexture.kt Outdated
Comment thread src/main/kotlin/gg/essential/universal/render/UGpuTextureImpl.kt
@Johni0702
Johni0702 requested a review from Traben-0 May 12, 2026 07:29

@Traben-0 Traben-0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Johni0702
Johni0702 merged commit 29152fc into master May 18, 2026
1 check passed
@Johni0702
Johni0702 deleted the feature/ugputexture branch May 18, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants