Skip to content

Vulkan text support - #3582

Open
Wunka wants to merge 24 commits into
PixelGuys:masterfrom
Wunka:vulkanText
Open

Vulkan text support#3582
Wunka wants to merge 24 commits into
PixelGuys:masterfrom
Wunka:vulkanText

Conversation

@Wunka

@Wunka Wunka commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread src/graphics.zig Outdated
Comment on lines +1267 to +1270
textureRect: [4]f32 align(16),
offset: [2]f32 align(8),
fontEffects: c_int,
textureBounds: [4]f32 align(16),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
textureRect: [4]f32 align(16),
offset: [2]f32 align(8),
fontEffects: c_int,
textureBounds: [4]f32 align(16),
glyphData: GlyphUniforms,

Comment thread src/graphics/vulkan.zig Outdated
}});
}

pub fn uploadGlyphs(self: Image, offset: i32, width: i32, height: i32, pitch: i32, data: []const u8) void {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this here? vulkan.zig is meant for low-level interfaces, glyphs definitely do not qualify

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

.... yeah a lot of my things were not even needed.... I added now a config struct to UploadData, where we can add things if we want to configure more.

Comment thread src/graphics/vulkan.zig Outdated

pub fn uploadData(self: Image, offset: usize, data: []const u8) void {
const UploadDataConfig = struct {
bufferOffset: usize = 0,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

pointless, please remove

Comment thread src/graphics.zig
Comment thread src/graphics.zig
Comment thread src/graphics/vulkan.zig Outdated
}

pub fn uploadImage(self: Image, other: Image) void {
currentFrame.uploadCommands.copyImageToImage(self, c.VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, other, c.VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, &.{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You also need to add pipeline barriers (like the other code) to ensure that both images are in the right layout and to return the dest image to VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

all done, I think

Comment thread src/graphics.zig Outdated
Comment thread src/graphics.zig Outdated
Comment thread src/graphics/vulkan.zig Outdated
Comment thread src/graphics.zig Outdated
c.glPixelStorei(c.GL_UNPACK_ALIGNMENT, 1);
c.glTexSubImage2D(c.GL_TEXTURE_2D, 0, textureOffset, 0, width, height, c.GL_RED, c.GL_UNSIGNED_BYTE, buffer);
if (main.settings.launchConfig.vulkanTestingMode) {
glyphTexture[0].vulkanImage.?.size = .{width, height, 1};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is still wrong (see other comment)

Comment thread src/graphics.zig Outdated
Comment thread src/graphics/vulkan.zig Outdated
Comment thread src/graphics/vulkan.zig Outdated
Comment thread src/graphics/vulkan.zig Outdated
Comment thread src/graphics/vulkan.zig Outdated
Comment thread src/graphics/vulkan.zig Outdated
Comment thread src/graphics/vulkan.zig Outdated
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