Maint: Updated Harfbuzz & Sokol libs to latest. Fixed breaking changes for sokol backend.

This commit is contained in:
2025-06-07 12:33:47 -04:00
parent dc8c73fc25
commit 434fe87fa0
62 changed files with 3504 additions and 2457 deletions

View File

@@ -39,11 +39,11 @@ setup_gfx_objects :: proc( ctx : ^Context, ve_ctx : ^ve.Context, vert_cap, index
Blend_State :: gfx.Blend_State Blend_State :: gfx.Blend_State
Border_Color :: gfx.Border_Color Border_Color :: gfx.Border_Color
Buffer_Desciption :: gfx.Buffer_Desc Buffer_Desciption :: gfx.Buffer_Desc
Buffer_Usage :: gfx.Usage Buffer_Usage :: gfx.Buffer_Usage
Buffer_Type :: gfx.Buffer_Type
Color_Target_State :: gfx.Color_Target_State Color_Target_State :: gfx.Color_Target_State
Filter :: gfx.Filter Filter :: gfx.Filter
Image_Desc :: gfx.Image_Desc Image_Desc :: gfx.Image_Desc
Image_Usage :: gfx.Image_Usage
Pass_Action :: gfx.Pass_Action Pass_Action :: gfx.Pass_Action
Range :: gfx.Range Range :: gfx.Range
Resource_State :: gfx.Resource_State Resource_State :: gfx.Resource_State
@@ -65,15 +65,13 @@ setup_gfx_objects :: proc( ctx : ^Context, ve_ctx : ^ve.Context, vert_cap, index
ctx.draw_list_vbuf = gfx.make_buffer( Buffer_Desciption { ctx.draw_list_vbuf = gfx.make_buffer( Buffer_Desciption {
size = cast(uint)(size_of([4]f32) * vert_cap), size = cast(uint)(size_of([4]f32) * vert_cap),
usage = Buffer_Usage.STREAM, usage = Buffer_Usage { vertex_buffer = true, dynamic_update = true, immutable = false },
type = Buffer_Type.VERTEXBUFFER,
}) })
assert( gfx.query_buffer_state( ctx.draw_list_vbuf) < Resource_State.FAILED, "Failed to make draw_list_vbuf" ) assert( gfx.query_buffer_state( ctx.draw_list_vbuf) < Resource_State.FAILED, "Failed to make draw_list_vbuf" )
ctx.draw_list_ibuf = gfx.make_buffer( Buffer_Desciption { ctx.draw_list_ibuf = gfx.make_buffer( Buffer_Desciption {
size = cast(uint)(size_of(u32) * index_cap), size = cast(uint)(size_of(u32) * index_cap),
usage = Buffer_Usage.STREAM, usage = { index_buffer = true, dynamic_update = true, immutable = false },
type = Buffer_Type.INDEXBUFFER,
}) })
assert( gfx.query_buffer_state( ctx.draw_list_ibuf) < Resource_State.FAILED, "Failed to make draw_list_iubuf" ) assert( gfx.query_buffer_state( ctx.draw_list_ibuf) < Resource_State.FAILED, "Failed to make draw_list_iubuf" )
@@ -136,12 +134,11 @@ setup_gfx_objects :: proc( ctx : ^Context, ve_ctx : ^ve.Context, vert_cap, index
{ {
ctx.glyph_rt_color = gfx.make_image( Image_Desc { ctx.glyph_rt_color = gfx.make_image( Image_Desc {
type = ._2D, type = ._2D,
render_target = true, usage = Image_Usage { render_attachment = true, immutable = true },
width = i32(ve_ctx.glyph_buffer.size.x), width = i32(ve_ctx.glyph_buffer.size.x),
height = i32(ve_ctx.glyph_buffer.size.y), height = i32(ve_ctx.glyph_buffer.size.y),
num_slices = 1, num_slices = 1,
num_mipmaps = 1, num_mipmaps = 1,
usage = .IMMUTABLE,
pixel_format = .R8, pixel_format = .R8,
sample_count = 1, sample_count = 1,
}) })
@@ -149,12 +146,11 @@ setup_gfx_objects :: proc( ctx : ^Context, ve_ctx : ^ve.Context, vert_cap, index
ctx.glyph_rt_depth = gfx.make_image( Image_Desc { ctx.glyph_rt_depth = gfx.make_image( Image_Desc {
type = ._2D, type = ._2D,
render_target = true, usage = Image_Usage { render_attachment = true, immutable = true },
width = i32(ve_ctx.glyph_buffer.size.x), width = i32(ve_ctx.glyph_buffer.size.x),
height = i32(ve_ctx.glyph_buffer.size.y), height = i32(ve_ctx.glyph_buffer.size.y),
num_slices = 1, num_slices = 1,
num_mipmaps = 1, num_mipmaps = 1,
usage = .IMMUTABLE,
pixel_format = .DEPTH, pixel_format = .DEPTH,
sample_count = 1, sample_count = 1,
}) })
@@ -270,12 +266,11 @@ setup_gfx_objects :: proc( ctx : ^Context, ve_ctx : ^ve.Context, vert_cap, index
{ {
ctx.atlas_rt_color = gfx.make_image( Image_Desc { ctx.atlas_rt_color = gfx.make_image( Image_Desc {
type = ._2D, type = ._2D,
render_target = true, usage = { render_attachment = true, immutable = true },
width = i32(ve_ctx.atlas.size.x), width = i32(ve_ctx.atlas.size.x),
height = i32(ve_ctx.atlas.size.y), height = i32(ve_ctx.atlas.size.y),
num_slices = 1, num_slices = 1,
num_mipmaps = 1, num_mipmaps = 1,
usage = .IMMUTABLE,
pixel_format = .R8, pixel_format = .R8,
sample_count = 1, sample_count = 1,
// TODO(Ed): Setup labels for debug tracing/logging // TODO(Ed): Setup labels for debug tracing/logging
@@ -285,12 +280,11 @@ setup_gfx_objects :: proc( ctx : ^Context, ve_ctx : ^ve.Context, vert_cap, index
ctx.atlas_rt_depth = gfx.make_image( Image_Desc { ctx.atlas_rt_depth = gfx.make_image( Image_Desc {
type = ._2D, type = ._2D,
render_target = true, usage = { render_attachment = true, immutable = true },
width = i32(ve_ctx.atlas.size.x), width = i32(ve_ctx.atlas.size.x),
height = i32(ve_ctx.atlas.size.y), height = i32(ve_ctx.atlas.size.y),
num_slices = 1, num_slices = 1,
num_mipmaps = 1, num_mipmaps = 1,
usage = .IMMUTABLE,
pixel_format = .DEPTH, pixel_format = .DEPTH,
sample_count = 1, sample_count = 1,
}) })

File diff suppressed because it is too large Load Diff

View File

@@ -87,12 +87,12 @@ draw_text_vs_source_glsl410 := [255]u8 {
void main() void main()
{ {
frag_color = vec4(draw_text_fs_params[1].xyz, draw_text_fs_params[1].w * ((1.0 / draw_text_fs_params[0].z) * (((texture(draw_text_src_texture_draw_text_src_sampler, fma(vec2(-0.5), draw_text_fs_params[0].xy, uv)).x + texture(draw_text_src_texture_draw_text_src_sampler, fma(vec2(-0.5, 0.5), draw_text_fs_params[0].xy, uv)).x) + texture(draw_text_src_texture_draw_text_src_sampler, fma(vec2(0.5, -0.5), draw_text_fs_params[0].xy, uv)).x) + texture(draw_text_src_texture_draw_text_src_sampler, fma(vec2(0.5), draw_text_fs_params[0].xy, uv)).x))); frag_color = vec4(draw_text_fs_params[1].xyz, draw_text_fs_params[1].w * ((1.0 / draw_text_fs_params[0].z) * (((texture(draw_text_src_texture_draw_text_src_sampler, uv + (vec2(-0.5) * draw_text_fs_params[0].xy)).x + texture(draw_text_src_texture_draw_text_src_sampler, uv + (vec2(-0.5, 0.5) * draw_text_fs_params[0].xy)).x) + texture(draw_text_src_texture_draw_text_src_sampler, uv + (vec2(0.5, -0.5) * draw_text_fs_params[0].xy)).x) + texture(draw_text_src_texture_draw_text_src_sampler, uv + (vec2(0.5) * draw_text_fs_params[0].xy)).x)));
} }
*/ */
@(private="file") @(private="file")
draw_text_fs_source_glsl410 := [758]u8 { draw_text_fs_source_glsl410 := [754]u8 {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e, 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e,
0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x64,0x72,0x61,0x77,0x5f, 0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x64,0x72,0x61,0x77,0x5f,
0x74,0x65,0x78,0x74,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32, 0x74,0x65,0x78,0x74,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,
@@ -116,31 +116,31 @@ draw_text_fs_source_glsl410 := [758]u8 {
0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65, 0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,
0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x64, 0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x64,
0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d, 0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,
0x70,0x6c,0x65,0x72,0x2c,0x20,0x66,0x6d,0x61,0x28,0x76,0x65,0x63,0x32,0x28,0x2d, 0x70,0x6c,0x65,0x72,0x2c,0x20,0x75,0x76,0x20,0x2b,0x20,0x28,0x76,0x65,0x63,0x32,
0x30,0x2e,0x35,0x29,0x2c,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f, 0x28,0x2d,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,
0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x2c, 0x78,0x74,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,
0x20,0x75,0x76,0x29,0x29,0x2e,0x78,0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72, 0x78,0x79,0x29,0x29,0x2e,0x78,0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,
0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,
0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,
0x74,0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x66,
0x6d,0x61,0x28,0x76,0x65,0x63,0x32,0x28,0x2d,0x30,0x2e,0x35,0x2c,0x20,0x30,0x2e,
0x35,0x29,0x2c,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x66,0x73,
0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x2c,0x20,0x75,
0x76,0x29,0x29,0x2e,0x78,0x29,0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,
0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74, 0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,
0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74, 0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,
0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x66,0x6d, 0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x75,0x76,
0x61,0x28,0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x35,0x2c,0x20,0x2d,0x30,0x2e,0x35, 0x20,0x2b,0x20,0x28,0x76,0x65,0x63,0x32,0x28,0x2d,0x30,0x2e,0x35,0x2c,0x20,0x30,
0x29,0x2c,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x66,0x73,0x5f, 0x2e,0x35,0x29,0x20,0x2a,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,
0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x2c,0x20,0x75,0x76, 0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x29,
0x29,0x29,0x2e,0x78,0x29,0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28, 0x29,0x2e,0x78,0x29,0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x64,
0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,0x65, 0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,
0x78,0x74,0x75,0x72,0x65,0x5f,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f, 0x74,0x75,0x72,0x65,0x5f,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,
0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x66,0x6d,0x61, 0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x75,0x76,0x20,0x2b,
0x28,0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x35,0x29,0x2c,0x20,0x64,0x72,0x61,0x77, 0x20,0x28,0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x35,0x2c,0x20,0x2d,0x30,0x2e,0x35,
0x29,0x20,0x2a,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x66,0x73,
0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x29,0x29,0x2e,
0x78,0x29,0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x64,0x72,0x61,
0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,
0x72,0x65,0x5f,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,
0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x75,0x76,0x20,0x2b,0x20,0x28,
0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x64,0x72,0x61,0x77,
0x5f,0x74,0x65,0x78,0x74,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b, 0x5f,0x74,0x65,0x78,0x74,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,
0x30,0x5d,0x2e,0x78,0x79,0x2c,0x20,0x75,0x76,0x29,0x29,0x2e,0x78,0x29,0x29,0x29, 0x30,0x5d,0x2e,0x78,0x79,0x29,0x29,0x2e,0x78,0x29,0x29,0x29,0x3b,0x0a,0x7d,0x0a,
0x3b,0x0a,0x7d,0x0a,0x0a,0x00, 0x0a,0x00,
} }
/* /*
#version 300 es #version 300 es
@@ -187,12 +187,12 @@ draw_text_vs_source_glsl300es := [237]u8 {
void main() void main()
{ {
frag_color = vec4(draw_text_fs_params[1].xyz, draw_text_fs_params[1].w * ((1.0 / draw_text_fs_params[0].z) * (((texture(draw_text_src_texture_draw_text_src_sampler, vec2(-0.5) * draw_text_fs_params[0].xy + uv).x + texture(draw_text_src_texture_draw_text_src_sampler, vec2(-0.5, 0.5) * draw_text_fs_params[0].xy + uv).x) + texture(draw_text_src_texture_draw_text_src_sampler, vec2(0.5, -0.5) * draw_text_fs_params[0].xy + uv).x) + texture(draw_text_src_texture_draw_text_src_sampler, vec2(0.5) * draw_text_fs_params[0].xy + uv).x))); frag_color = vec4(draw_text_fs_params[1].xyz, draw_text_fs_params[1].w * ((1.0 / draw_text_fs_params[0].z) * (((texture(draw_text_src_texture_draw_text_src_sampler, uv + (vec2(-0.5) * draw_text_fs_params[0].xy)).x + texture(draw_text_src_texture_draw_text_src_sampler, uv + (vec2(-0.5, 0.5) * draw_text_fs_params[0].xy)).x) + texture(draw_text_src_texture_draw_text_src_sampler, uv + (vec2(0.5, -0.5) * draw_text_fs_params[0].xy)).x) + texture(draw_text_src_texture_draw_text_src_sampler, uv + (vec2(0.5) * draw_text_fs_params[0].xy)).x)));
} }
*/ */
@(private="file") @(private="file")
draw_text_fs_source_glsl300es := [798]u8 { draw_text_fs_source_glsl300es := [806]u8 {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a, 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a,
0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d, 0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d,
0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69, 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69,
@@ -219,30 +219,31 @@ draw_text_fs_source_glsl300es := [798]u8 {
0x2a,0x20,0x28,0x28,0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x64,0x72,0x61, 0x2a,0x20,0x28,0x28,0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x64,0x72,0x61,
0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75, 0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,
0x72,0x65,0x5f,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63, 0x72,0x65,0x5f,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,
0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x76,0x65,0x63,0x32,0x28,0x2d, 0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x75,0x76,0x20,0x2b,0x20,0x28,
0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74, 0x76,0x65,0x63,0x32,0x28,0x2d,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x64,0x72,0x61,
0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x79, 0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,
0x20,0x2b,0x20,0x75,0x76,0x29,0x2e,0x78,0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75, 0x5b,0x30,0x5d,0x2e,0x78,0x79,0x29,0x29,0x2e,0x78,0x20,0x2b,0x20,0x74,0x65,0x78,
0x74,0x75,0x72,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,
0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x64,0x72,0x61,0x77,0x5f,
0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,
0x2c,0x20,0x75,0x76,0x20,0x2b,0x20,0x28,0x76,0x65,0x63,0x32,0x28,0x2d,0x30,0x2e,
0x35,0x2c,0x20,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,
0x65,0x78,0x74,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,
0x2e,0x78,0x79,0x29,0x29,0x2e,0x78,0x29,0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,
0x72,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63, 0x72,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,
0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x64,0x72,0x61,0x77,0x5f,0x74,0x65, 0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,
0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20, 0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,
0x76,0x65,0x63,0x32,0x28,0x2d,0x30,0x2e,0x35,0x2c,0x20,0x30,0x2e,0x35,0x29,0x20, 0x75,0x76,0x20,0x2b,0x20,0x28,0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x35,0x2c,0x20,
0x2a,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x66,0x73,0x5f,0x70, 0x2d,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,
0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x20,0x2b,0x20,0x75,0x76, 0x74,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,
0x29,0x2e,0x78,0x29,0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x64, 0x79,0x29,0x29,0x2e,0x78,0x29,0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,
0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78, 0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,
0x74,0x75,0x72,0x65,0x5f,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73, 0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,
0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x76,0x65,0x63,0x32, 0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x75,0x76,
0x28,0x30,0x2e,0x35,0x2c,0x20,0x2d,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x64,0x72, 0x20,0x2b,0x20,0x28,0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,
0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d, 0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,
0x73,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x20,0x2b,0x20,0x75,0x76,0x29,0x2e,0x78,0x29, 0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x29,0x29,0x2e,0x78,0x29,0x29,0x29,
0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x64,0x72,0x61,0x77,0x5f, 0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,
0x5f,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x73,
0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x35,
0x29,0x20,0x2a,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x66,0x73,
0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x79,0x20,0x2b,0x20,
0x75,0x76,0x29,0x2e,0x78,0x29,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
} }
/* /*
static float4 gl_Position; static float4 gl_Position;
@@ -354,7 +355,7 @@ draw_text_vs_source_hlsl4 := [724]u8 {
void frag_main() void frag_main()
{ {
frag_color = float4(_32_colour.xyz, _32_colour.w * ((1.0f / _32_over_sample) * (((draw_text_src_texture.Sample(draw_text_src_sampler, mad((-0.5f).xx, _32_glyph_buffer_size, uv)).x + draw_text_src_texture.Sample(draw_text_src_sampler, mad(float2(-0.5f, 0.5f), _32_glyph_buffer_size, uv)).x) + draw_text_src_texture.Sample(draw_text_src_sampler, mad(float2(0.5f, -0.5f), _32_glyph_buffer_size, uv)).x) + draw_text_src_texture.Sample(draw_text_src_sampler, mad(0.5f.xx, _32_glyph_buffer_size, uv)).x))); frag_color = float4(_32_colour.xyz, _32_colour.w * ((1.0f / _32_over_sample) * (((draw_text_src_texture.Sample(draw_text_src_sampler, uv + ((-0.5f).xx * _32_glyph_buffer_size)).x + draw_text_src_texture.Sample(draw_text_src_sampler, uv + (float2(-0.5f, 0.5f) * _32_glyph_buffer_size)).x) + draw_text_src_texture.Sample(draw_text_src_sampler, uv + (float2(0.5f, -0.5f) * _32_glyph_buffer_size)).x) + draw_text_src_texture.Sample(draw_text_src_sampler, uv + (0.5f.xx * _32_glyph_buffer_size)).x)));
} }
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
@@ -367,7 +368,7 @@ draw_text_vs_source_hlsl4 := [724]u8 {
} }
*/ */
@(private="file") @(private="file")
draw_text_fs_source_hlsl4 := [1198]u8 { draw_text_fs_source_hlsl4 := [1194]u8 {
0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78, 0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,
0x74,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3a,0x20,0x72,0x65, 0x74,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x3a,0x20,0x72,0x65,
0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x62,0x30,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, 0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x62,0x30,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,
@@ -406,43 +407,43 @@ draw_text_fs_source_hlsl4 := [1198]u8 {
0x70,0x6c,0x65,0x29,0x20,0x2a,0x20,0x28,0x28,0x28,0x64,0x72,0x61,0x77,0x5f,0x74, 0x70,0x6c,0x65,0x29,0x20,0x2a,0x20,0x28,0x28,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,
0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x2e, 0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x2e,
0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74, 0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,
0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x6d,0x61, 0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x75,0x76,
0x64,0x28,0x28,0x2d,0x30,0x2e,0x35,0x66,0x29,0x2e,0x78,0x78,0x2c,0x20,0x5f,0x33, 0x20,0x2b,0x20,0x28,0x28,0x2d,0x30,0x2e,0x35,0x66,0x29,0x2e,0x78,0x78,0x20,0x2a,
0x32,0x5f,0x67,0x6c,0x79,0x70,0x68,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0x5f,0x73, 0x20,0x5f,0x33,0x32,0x5f,0x67,0x6c,0x79,0x70,0x68,0x5f,0x62,0x75,0x66,0x66,0x65,
0x69,0x7a,0x65,0x2c,0x20,0x75,0x76,0x29,0x29,0x2e,0x78,0x20,0x2b,0x20,0x64,0x72, 0x72,0x5f,0x73,0x69,0x7a,0x65,0x29,0x29,0x2e,0x78,0x20,0x2b,0x20,0x64,0x72,0x61,
0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74, 0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,
0x75,0x72,0x65,0x2e,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x64,0x72,0x61,0x77,0x5f, 0x72,0x65,0x2e,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,
0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72, 0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,
0x2c,0x20,0x6d,0x61,0x64,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x2d,0x30,0x2e, 0x20,0x75,0x76,0x20,0x2b,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x2d,0x30,
0x35,0x66,0x2c,0x20,0x30,0x2e,0x35,0x66,0x29,0x2c,0x20,0x5f,0x33,0x32,0x5f,0x67, 0x2e,0x35,0x66,0x2c,0x20,0x30,0x2e,0x35,0x66,0x29,0x20,0x2a,0x20,0x5f,0x33,0x32,
0x6c,0x79,0x70,0x68,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0x5f,0x73,0x69,0x7a,0x65, 0x5f,0x67,0x6c,0x79,0x70,0x68,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0x5f,0x73,0x69,
0x2c,0x20,0x75,0x76,0x29,0x29,0x2e,0x78,0x29,0x20,0x2b,0x20,0x64,0x72,0x61,0x77, 0x7a,0x65,0x29,0x29,0x2e,0x78,0x29,0x20,0x2b,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,
0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,
0x65,0x2e,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,
0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,
0x6d,0x61,0x64,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,0x2e,0x35,0x66,0x2c,
0x20,0x2d,0x30,0x2e,0x35,0x66,0x29,0x2c,0x20,0x5f,0x33,0x32,0x5f,0x67,0x6c,0x79,
0x70,0x68,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0x5f,0x73,0x69,0x7a,0x65,0x2c,0x20,
0x75,0x76,0x29,0x29,0x2e,0x78,0x29,0x20,0x2b,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,
0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x2e, 0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x2e,
0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74, 0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,
0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x6d,0x61, 0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x75,0x76,
0x64,0x28,0x30,0x2e,0x35,0x66,0x2e,0x78,0x78,0x2c,0x20,0x5f,0x33,0x32,0x5f,0x67, 0x20,0x2b,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,0x2e,0x35,0x66,0x2c,
0x20,0x2d,0x30,0x2e,0x35,0x66,0x29,0x20,0x2a,0x20,0x5f,0x33,0x32,0x5f,0x67,0x6c,
0x79,0x70,0x68,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0x5f,0x73,0x69,0x7a,0x65,0x29,
0x29,0x2e,0x78,0x29,0x20,0x2b,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,
0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x2e,0x53,0x61,0x6d,
0x70,0x6c,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,
0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x75,0x76,0x20,0x2b,0x20,
0x28,0x30,0x2e,0x35,0x66,0x2e,0x78,0x78,0x20,0x2a,0x20,0x5f,0x33,0x32,0x5f,0x67,
0x6c,0x79,0x70,0x68,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0x5f,0x73,0x69,0x7a,0x65, 0x6c,0x79,0x70,0x68,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0x5f,0x73,0x69,0x7a,0x65,
0x2c,0x20,0x75,0x76,0x29,0x29,0x2e,0x78,0x29,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a, 0x29,0x29,0x2e,0x78,0x29,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,
0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70, 0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x6d,
0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72, 0x61,0x69,0x6e,0x28,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,
0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f, 0x49,0x6e,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,
0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x75,0x76,0x20, 0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x73,0x74,
0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x75,0x76, 0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x75,0x76,0x3b,0x0a,0x20,0x20,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28, 0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,
0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f, 0x20,0x20,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,
0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f, 0x75,0x74,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,
0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67, 0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,
0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, 0x74,0x70,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,
0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, 0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,
0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,0x61, 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,
0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x00, 0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x00,
} }
/* /*
#include <metal_stdlib> #include <metal_stdlib>
@@ -531,13 +532,13 @@ draw_text_vs_source_metal_macos := [495]u8 {
fragment main0_out main0(main0_in in [[stage_in]], constant draw_text_fs_params& _32 [[buffer(0)]], texture2d<float> draw_text_src_texture [[texture(0)]], sampler draw_text_src_sampler [[sampler(0)]]) fragment main0_out main0(main0_in in [[stage_in]], constant draw_text_fs_params& _32 [[buffer(0)]], texture2d<float> draw_text_src_texture [[texture(0)]], sampler draw_text_src_sampler [[sampler(0)]])
{ {
main0_out out = {}; main0_out out = {};
out.frag_color = float4(_32.colour.xyz, _32.colour.w * ((1.0 / _32.over_sample) * (((draw_text_src_texture.sample(draw_text_src_sampler, fma(float2(-0.5), _32.glyph_buffer_size, in.uv)).x + draw_text_src_texture.sample(draw_text_src_sampler, fma(float2(-0.5, 0.5), _32.glyph_buffer_size, in.uv)).x) + draw_text_src_texture.sample(draw_text_src_sampler, fma(float2(0.5, -0.5), _32.glyph_buffer_size, in.uv)).x) + draw_text_src_texture.sample(draw_text_src_sampler, fma(float2(0.5), _32.glyph_buffer_size, in.uv)).x))); out.frag_color = float4(_32.colour.xyz, _32.colour.w * ((1.0 / _32.over_sample) * (((draw_text_src_texture.sample(draw_text_src_sampler, (in.uv + (float2(-0.5) * _32.glyph_buffer_size))).x + draw_text_src_texture.sample(draw_text_src_sampler, (in.uv + (float2(-0.5, 0.5) * _32.glyph_buffer_size))).x) + draw_text_src_texture.sample(draw_text_src_sampler, (in.uv + (float2(0.5, -0.5) * _32.glyph_buffer_size))).x) + draw_text_src_texture.sample(draw_text_src_sampler, (in.uv + (float2(0.5) * _32.glyph_buffer_size))).x)));
return out; return out;
} }
*/ */
@(private="file") @(private="file")
draw_text_fs_source_metal_macos := [1058]u8 { draw_text_fs_source_metal_macos := [1062]u8 {
0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,
0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,
0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,
@@ -579,32 +580,32 @@ draw_text_fs_source_metal_macos := [1058]u8 {
0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75, 0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,
0x72,0x65,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74, 0x72,0x65,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,
0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c, 0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,
0x20,0x66,0x6d,0x61,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x2d,0x30,0x2e,0x35, 0x20,0x28,0x69,0x6e,0x2e,0x75,0x76,0x20,0x2b,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,
0x29,0x2c,0x20,0x5f,0x33,0x32,0x2e,0x67,0x6c,0x79,0x70,0x68,0x5f,0x62,0x75,0x66, 0x32,0x28,0x2d,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x5f,0x33,0x32,0x2e,0x67,0x6c,
0x66,0x65,0x72,0x5f,0x73,0x69,0x7a,0x65,0x2c,0x20,0x69,0x6e,0x2e,0x75,0x76,0x29, 0x79,0x70,0x68,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0x5f,0x73,0x69,0x7a,0x65,0x29,
0x29,0x2e,0x78,0x20,0x2b,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f, 0x29,0x29,0x2e,0x78,0x20,0x2b,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,
0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x2e,0x73,0x61,0x6d,0x70, 0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x2e,0x73,0x61,0x6d,
0x6c,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63, 0x70,0x6c,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,
0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x66,0x6d,0x61,0x28,0x66,0x6c, 0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x28,0x69,0x6e,0x2e,0x75,
0x6f,0x61,0x74,0x32,0x28,0x2d,0x30,0x2e,0x35,0x2c,0x20,0x30,0x2e,0x35,0x29,0x2c, 0x76,0x20,0x2b,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x2d,0x30,0x2e,0x35,
0x20,0x5f,0x33,0x32,0x2e,0x67,0x6c,0x79,0x70,0x68,0x5f,0x62,0x75,0x66,0x66,0x65, 0x2c,0x20,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x5f,0x33,0x32,0x2e,0x67,0x6c,0x79,
0x72,0x5f,0x73,0x69,0x7a,0x65,0x2c,0x20,0x69,0x6e,0x2e,0x75,0x76,0x29,0x29,0x2e, 0x70,0x68,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0x5f,0x73,0x69,0x7a,0x65,0x29,0x29,
0x78,0x29,0x20,0x2b,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73, 0x29,0x2e,0x78,0x29,0x20,0x2b,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,
0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x2e,0x73,0x61,0x6d,0x70,0x6c, 0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x2e,0x73,0x61,0x6d,
0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f, 0x70,0x6c,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,
0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x66,0x6d,0x61,0x28,0x66,0x6c,0x6f, 0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x28,0x69,0x6e,0x2e,0x75,
0x61,0x74,0x32,0x28,0x30,0x2e,0x35,0x2c,0x20,0x2d,0x30,0x2e,0x35,0x29,0x2c,0x20, 0x76,0x20,0x2b,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,0x2e,0x35,0x2c,
0x5f,0x33,0x32,0x2e,0x67,0x6c,0x79,0x70,0x68,0x5f,0x62,0x75,0x66,0x66,0x65,0x72, 0x20,0x2d,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x5f,0x33,0x32,0x2e,0x67,0x6c,0x79,
0x5f,0x73,0x69,0x7a,0x65,0x2c,0x20,0x69,0x6e,0x2e,0x75,0x76,0x29,0x29,0x2e,0x78, 0x70,0x68,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0x5f,0x73,0x69,0x7a,0x65,0x29,0x29,
0x29,0x20,0x2b,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72, 0x29,0x2e,0x78,0x29,0x20,0x2b,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,
0x63,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65, 0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x2e,0x73,0x61,0x6d,
0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x73, 0x70,0x6c,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,
0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x66,0x6d,0x61,0x28,0x66,0x6c,0x6f,0x61, 0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x28,0x69,0x6e,0x2e,0x75,
0x74,0x32,0x28,0x30,0x2e,0x35,0x29,0x2c,0x20,0x5f,0x33,0x32,0x2e,0x67,0x6c,0x79, 0x76,0x20,0x2b,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,0x2e,0x35,0x29,
0x70,0x68,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0x5f,0x73,0x69,0x7a,0x65,0x2c,0x20, 0x20,0x2a,0x20,0x5f,0x33,0x32,0x2e,0x67,0x6c,0x79,0x70,0x68,0x5f,0x62,0x75,0x66,
0x69,0x6e,0x2e,0x75,0x76,0x29,0x29,0x2e,0x78,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20, 0x66,0x65,0x72,0x5f,0x73,0x69,0x7a,0x65,0x29,0x29,0x29,0x2e,0x78,0x29,0x29,0x29,
0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a, 0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,
0x0a,0x00, 0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
} }
/* /*
diagnostic(off, derivative_uniformity); diagnostic(off, derivative_uniformity);
@@ -618,11 +619,8 @@ draw_text_fs_source_metal_macos := [1058]u8 {
var<private> gl_Position : vec4f; var<private> gl_Position : vec4f;
fn main_1() { fn main_1() {
let x_16 : f32 = v_texture.x; uv = vec2f(v_texture.x, (1.0f - v_texture.y));
let x_20 : f32 = v_texture.y; let x_35 = ((v_position * 2.0f) - vec2f(1.0f));
uv = vec2f(x_16, (1.0f - x_20));
let x_31 : vec2f = v_position;
let x_35 : vec2f = ((x_31 * 2.0f) - vec2f(1.0f, 1.0f));
gl_Position = vec4f(x_35.x, x_35.y, 0.0f, 1.0f); gl_Position = vec4f(x_35.x, x_35.y, 0.0f, 1.0f);
return; return;
} }
@@ -641,10 +639,9 @@ draw_text_fs_source_metal_macos := [1058]u8 {
main_1(); main_1();
return main_out(uv, gl_Position); return main_out(uv, gl_Position);
} }
*/ */
@(private="file") @(private="file")
draw_text_vs_source_wgsl := [756]u8 { draw_text_vs_source_wgsl := [664]u8 {
0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20, 0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20,
0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f, 0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f,
0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69, 0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,
@@ -656,43 +653,37 @@ draw_text_vs_source_wgsl := [756]u8 {
0x63,0x32,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74, 0x63,0x32,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,
0x65,0x3e,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a, 0x65,0x3e,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,
0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e, 0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,
0x5f,0x31,0x28,0x29,0x20,0x7b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31, 0x5f,0x31,0x28,0x29,0x20,0x7b,0x0a,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x76,0x65,
0x36,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x76,0x5f,0x74,0x65,0x78,0x74, 0x63,0x32,0x66,0x28,0x76,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x2e,0x78,0x2c,
0x75,0x72,0x65,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32, 0x20,0x28,0x31,0x2e,0x30,0x66,0x20,0x2d,0x20,0x76,0x5f,0x74,0x65,0x78,0x74,0x75,
0x30,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x76,0x5f,0x74,0x65,0x78,0x74, 0x72,0x65,0x2e,0x79,0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,
0x75,0x72,0x65,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x76,0x65, 0x33,0x35,0x20,0x3d,0x20,0x28,0x28,0x76,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,
0x63,0x32,0x66,0x28,0x78,0x5f,0x31,0x36,0x2c,0x20,0x28,0x31,0x2e,0x30,0x66,0x20, 0x6e,0x20,0x2a,0x20,0x32,0x2e,0x30,0x66,0x29,0x20,0x2d,0x20,0x76,0x65,0x63,0x32,
0x2d,0x20,0x78,0x5f,0x32,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20, 0x66,0x28,0x31,0x2e,0x30,0x66,0x29,0x29,0x3b,0x0a,0x20,0x20,0x67,0x6c,0x5f,0x50,
0x78,0x5f,0x33,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x76, 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x66,0x28,
0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74, 0x78,0x5f,0x33,0x35,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x33,0x35,0x2e,0x79,0x2c,0x20,
0x20,0x78,0x5f,0x33,0x35,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20, 0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x20,0x20,0x72,
0x28,0x28,0x78,0x5f,0x33,0x31,0x20,0x2a,0x20,0x32,0x2e,0x30,0x66,0x29,0x20,0x2d, 0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,
0x20,0x76,0x65,0x63,0x32,0x66,0x28,0x31,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30, 0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x40,0x6c,
0x66,0x29,0x29,0x3b,0x0a,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69, 0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x0a,0x20,0x20,0x75,0x76,0x5f,
0x6f,0x6e,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x66,0x28,0x78,0x5f,0x33,0x35,0x2e, 0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x2c,0x0a,0x20,0x20,0x40,0x62,0x75,
0x78,0x2c,0x20,0x78,0x5f,0x33,0x35,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2c, 0x69,0x6c,0x74,0x69,0x6e,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x0a,
0x20,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, 0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,
0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e, 0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x76,0x65,0x72,0x74,0x65,
0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69, 0x78,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x28,0x40,0x6c,0x6f,0x63,0x61,0x74,
0x6f,0x6e,0x28,0x30,0x29,0x0a,0x20,0x20,0x75,0x76,0x5f,0x31,0x20,0x3a,0x20,0x76, 0x69,0x6f,0x6e,0x28,0x31,0x29,0x20,0x76,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,
0x65,0x63,0x32,0x66,0x2c,0x0a,0x20,0x20,0x40,0x62,0x75,0x69,0x6c,0x74,0x69,0x6e, 0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x2c,0x20,
0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x0a,0x20,0x20,0x67,0x6c,0x5f, 0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,0x76,0x5f,0x70,
0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66, 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,
0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x76,0x65,0x72,0x74,0x65,0x78,0x0a,0x66,0x6e,0x20, 0x76,0x65,0x63,0x32,0x66,0x29,0x20,0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,
0x6d,0x61,0x69,0x6e,0x28,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x31, 0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x76,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,
0x29,0x20,0x76,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x70,0x61,0x72,0x61, 0x20,0x3d,0x20,0x76,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x70,0x61,0x72,
0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x2c,0x20,0x40,0x6c,0x6f,0x63,0x61, 0x61,0x6d,0x3b,0x0a,0x20,0x20,0x76,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,
0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,0x76,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69, 0x20,0x3d,0x20,0x76,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x70,0x61,
0x6f,0x6e,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66, 0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x3b,
0x29,0x20,0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a, 0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,
0x20,0x20,0x76,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x20,0x3d,0x20,0x76,0x5f, 0x75,0x74,0x28,0x75,0x76,0x2c,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,
0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20, 0x6f,0x6e,0x29,0x3b,0x0a,0x7d,0x0a,0x00,
0x20,0x76,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x76,0x5f,
0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,
0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,
0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x28,0x75,0x76,
0x2c,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,
0x7d,0x0a,0x0a,0x00,
} }
/* /*
diagnostic(off, derivative_uniformity); diagnostic(off, derivative_uniformity);
@@ -706,13 +697,13 @@ draw_text_vs_source_wgsl := [756]u8 {
colour : vec4f, colour : vec4f,
} }
@group(1) @binding(64) var draw_text_src_texture : texture_2d<f32>; @binding(64) @group(1) var draw_text_src_texture : texture_2d<f32>;
@group(1) @binding(80) var draw_text_src_sampler : sampler; @binding(80) @group(1) var draw_text_src_sampler : sampler;
var<private> uv : vec2f; var<private> uv : vec2f;
@group(0) @binding(8) var<uniform> x_32 : draw_text_fs_params; @binding(8) @group(0) var<uniform> x_32 : draw_text_fs_params;
var<private> frag_color : vec4f; var<private> frag_color : vec4f;
@@ -720,35 +711,29 @@ draw_text_vs_source_wgsl := [756]u8 {
var alpha : f32; var alpha : f32;
var texture_size : vec2f; var texture_size : vec2f;
var down_sample : f32; var down_sample : f32;
let x_22 : vec2f = uv; let x_22 = uv;
let x_24 : vec4f = textureSample(draw_text_src_texture, draw_text_src_sampler, x_22); let x_24 = textureSample(draw_text_src_texture, draw_text_src_sampler, x_22);
alpha = x_24.x; alpha = x_24.x;
let x_37 : vec2f = x_32.glyph_buffer_size; texture_size = x_32.glyph_buffer_size;
texture_size = x_37; down_sample = (1.0f / x_32.over_sample);
let x_43 : f32 = x_32.over_sample; let x_48 = uv;
down_sample = (1.0f / x_43); let x_51 = texture_size;
let x_48 : vec2f = uv; let x_54 = textureSample(draw_text_src_texture, draw_text_src_sampler, (x_48 + (vec2f(-0.5f) * x_51)));
let x_51 : vec2f = texture_size; let x_56 = down_sample;
let x_54 : vec4f = textureSample(draw_text_src_texture, draw_text_src_sampler, (x_48 + (vec2f(-0.5f, -0.5f) * x_51))); let x_61 = uv;
let x_56 : f32 = down_sample; let x_64 = texture_size;
let x_61 : vec2f = uv; let x_67 = textureSample(draw_text_src_texture, draw_text_src_sampler, (x_61 + (vec2f(-0.5f, 0.5f) * x_64)));
let x_64 : vec2f = texture_size; let x_69 = down_sample;
let x_67 : vec4f = textureSample(draw_text_src_texture, draw_text_src_sampler, (x_61 + (vec2f(-0.5f, 0.5f) * x_64))); let x_75 = uv;
let x_69 : f32 = down_sample; let x_77 = texture_size;
let x_75 : vec2f = uv; let x_80 = textureSample(draw_text_src_texture, draw_text_src_sampler, (x_75 + (vec2f(0.5f, -0.5f) * x_77)));
let x_77 : vec2f = texture_size; let x_82 = down_sample;
let x_80 : vec4f = textureSample(draw_text_src_texture, draw_text_src_sampler, (x_75 + (vec2f(0.5f, -0.5f) * x_77))); let x_88 = uv;
let x_82 : f32 = down_sample; let x_90 = texture_size;
let x_88 : vec2f = uv; let x_93 = textureSample(draw_text_src_texture, draw_text_src_sampler, (x_88 + (vec2f(0.5f) * x_90)));
let x_90 : vec2f = texture_size; alpha = ((((x_54.x * x_56) + (x_67.x * x_69)) + (x_80.x * x_82)) + (x_93.x * down_sample));
let x_93 : vec4f = textureSample(draw_text_src_texture, draw_text_src_sampler, (x_88 + (vec2f(0.5f, 0.5f) * x_90))); let x_105 = x_32.colour.xyz;
let x_95 : f32 = down_sample; frag_color = vec4f(x_105.x, x_105.y, x_105.z, (x_32.colour.w * alpha));
alpha = ((((x_54.x * x_56) + (x_67.x * x_69)) + (x_80.x * x_82)) + (x_93.x * x_95));
let x_104 : vec4f = x_32.colour;
let x_105 : vec3f = vec3f(x_104.x, x_104.y, x_104.z);
let x_108 : f32 = x_32.colour.w;
let x_109 : f32 = alpha;
frag_color = vec4f(x_105.x, x_105.y, x_105.z, (x_108 * x_109));
return; return;
} }
@@ -763,10 +748,9 @@ draw_text_vs_source_wgsl := [756]u8 {
main_1(); main_1();
return main_out(frag_color); return main_out(frag_color);
} }
*/ */
@(private="file") @(private="file")
draw_text_fs_source_wgsl := [2160]u8 { draw_text_fs_source_wgsl := [1825]u8 {
0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20, 0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20,
0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f, 0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f,
0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20, 0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,
@@ -779,18 +763,18 @@ draw_text_fs_source_wgsl := [2160]u8 {
0x73,0x61,0x6d,0x70,0x6c,0x65,0x20,0x3a,0x20,0x66,0x33,0x32,0x2c,0x0a,0x20,0x20, 0x73,0x61,0x6d,0x70,0x6c,0x65,0x20,0x3a,0x20,0x66,0x33,0x32,0x2c,0x0a,0x20,0x20,
0x2f,0x2a,0x20,0x40,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x31,0x36,0x29,0x20,0x2a, 0x2f,0x2a,0x20,0x40,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x31,0x36,0x29,0x20,0x2a,
0x2f,0x0a,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x75,0x72,0x20,0x3a,0x20,0x76,0x65,0x63, 0x2f,0x0a,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x75,0x72,0x20,0x3a,0x20,0x76,0x65,0x63,
0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x67,0x72,0x6f,0x75,0x70,0x28,0x31,0x29, 0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x28,
0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x28,0x36,0x34,0x29,0x20,0x76,0x61, 0x36,0x34,0x29,0x20,0x40,0x67,0x72,0x6f,0x75,0x70,0x28,0x31,0x29,0x20,0x76,0x61,
0x72,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f, 0x72,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,
0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x20,0x3a,0x20,0x74,0x65,0x78,0x74,0x75,0x72, 0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x20,0x3a,0x20,0x74,0x65,0x78,0x74,0x75,0x72,
0x65,0x5f,0x32,0x64,0x3c,0x66,0x33,0x32,0x3e,0x3b,0x0a,0x0a,0x40,0x67,0x72,0x6f, 0x65,0x5f,0x32,0x64,0x3c,0x66,0x33,0x32,0x3e,0x3b,0x0a,0x0a,0x40,0x62,0x69,0x6e,
0x75,0x70,0x28,0x31,0x29,0x20,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x28,0x38, 0x64,0x69,0x6e,0x67,0x28,0x38,0x30,0x29,0x20,0x40,0x67,0x72,0x6f,0x75,0x70,0x28,
0x30,0x29,0x20,0x76,0x61,0x72,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74, 0x31,0x29,0x20,0x76,0x61,0x72,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,
0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x20,0x3a,0x20,0x73, 0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x20,0x3a,0x20,0x73,
0x61,0x6d,0x70,0x6c,0x65,0x72,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69, 0x61,0x6d,0x70,0x6c,0x65,0x72,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,
0x76,0x61,0x74,0x65,0x3e,0x20,0x75,0x76,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66, 0x76,0x61,0x74,0x65,0x3e,0x20,0x75,0x76,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,
0x3b,0x0a,0x0a,0x40,0x67,0x72,0x6f,0x75,0x70,0x28,0x30,0x29,0x20,0x40,0x62,0x69, 0x3b,0x0a,0x0a,0x40,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x28,0x38,0x29,0x20,0x40,
0x6e,0x64,0x69,0x6e,0x67,0x28,0x38,0x29,0x20,0x76,0x61,0x72,0x3c,0x75,0x6e,0x69, 0x67,0x72,0x6f,0x75,0x70,0x28,0x30,0x29,0x20,0x76,0x61,0x72,0x3c,0x75,0x6e,0x69,
0x66,0x6f,0x72,0x6d,0x3e,0x20,0x78,0x5f,0x33,0x32,0x20,0x3a,0x20,0x64,0x72,0x61, 0x66,0x6f,0x72,0x6d,0x3e,0x20,0x78,0x5f,0x33,0x32,0x20,0x3a,0x20,0x64,0x72,0x61,
0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73, 0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,
0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20, 0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,
@@ -801,108 +785,87 @@ draw_text_fs_source_wgsl := [2160]u8 {
0x75,0x72,0x65,0x5f,0x73,0x69,0x7a,0x65,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66, 0x75,0x72,0x65,0x5f,0x73,0x69,0x7a,0x65,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,
0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x64,0x6f,0x77,0x6e,0x5f,0x73,0x61,0x6d, 0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x64,0x6f,0x77,0x6e,0x5f,0x73,0x61,0x6d,
0x70,0x6c,0x65,0x20,0x3a,0x20,0x66,0x33,0x32,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74, 0x70,0x6c,0x65,0x20,0x3a,0x20,0x66,0x33,0x32,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,
0x20,0x78,0x5f,0x32,0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20, 0x20,0x78,0x5f,0x32,0x32,0x20,0x3d,0x20,0x75,0x76,0x3b,0x0a,0x20,0x20,0x6c,0x65,
0x75,0x76,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x34,0x20,0x3a, 0x74,0x20,0x78,0x5f,0x32,0x34,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,
0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,
0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74, 0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,
0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x2c,0x20,0x64,0x72, 0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x2c,0x20,0x64,0x72,
0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70, 0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,
0x6c,0x65,0x72,0x2c,0x20,0x78,0x5f,0x32,0x32,0x29,0x3b,0x0a,0x20,0x20,0x61,0x6c, 0x6c,0x65,0x72,0x2c,0x20,0x78,0x5f,0x32,0x32,0x29,0x3b,0x0a,0x20,0x20,0x61,0x6c,
0x70,0x68,0x61,0x20,0x3d,0x20,0x78,0x5f,0x32,0x34,0x2e,0x78,0x3b,0x0a,0x20,0x20, 0x70,0x68,0x61,0x20,0x3d,0x20,0x78,0x5f,0x32,0x34,0x2e,0x78,0x3b,0x0a,0x20,0x20,
0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x37,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66, 0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x73,0x69,0x7a,0x65,0x20,0x3d,0x20,0x78,
0x20,0x3d,0x20,0x78,0x5f,0x33,0x32,0x2e,0x67,0x6c,0x79,0x70,0x68,0x5f,0x62,0x75, 0x5f,0x33,0x32,0x2e,0x67,0x6c,0x79,0x70,0x68,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,
0x66,0x66,0x65,0x72,0x5f,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x20,0x20,0x74,0x65,0x78, 0x5f,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x20,0x20,0x64,0x6f,0x77,0x6e,0x5f,0x73,0x61,
0x74,0x75,0x72,0x65,0x5f,0x73,0x69,0x7a,0x65,0x20,0x3d,0x20,0x78,0x5f,0x33,0x37,
0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x34,0x33,0x20,0x3a,0x20,0x66,
0x33,0x32,0x20,0x3d,0x20,0x78,0x5f,0x33,0x32,0x2e,0x6f,0x76,0x65,0x72,0x5f,0x73,
0x61,0x6d,0x70,0x6c,0x65,0x3b,0x0a,0x20,0x20,0x64,0x6f,0x77,0x6e,0x5f,0x73,0x61,
0x6d,0x70,0x6c,0x65,0x20,0x3d,0x20,0x28,0x31,0x2e,0x30,0x66,0x20,0x2f,0x20,0x78, 0x6d,0x70,0x6c,0x65,0x20,0x3d,0x20,0x28,0x31,0x2e,0x30,0x66,0x20,0x2f,0x20,0x78,
0x5f,0x34,0x33,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x34,0x38, 0x5f,0x33,0x32,0x2e,0x6f,0x76,0x65,0x72,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x29,
0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x75,0x76,0x3b,0x0a,0x20, 0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x34,0x38,0x20,0x3d,0x20,0x75,
0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x35,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x32, 0x76,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x35,0x31,0x20,0x3d,0x20,
0x66,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x73,0x69,0x7a,0x65, 0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x20,0x20,
0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x35,0x34,0x20,0x3a,0x20,0x76, 0x6c,0x65,0x74,0x20,0x78,0x5f,0x35,0x34,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,
0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x53,0x61, 0x72,0x65,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,
0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x2c,0x20,
0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,
0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x28,0x78,0x5f,0x34,0x38,0x20,0x2b,0x20,0x28,
0x76,0x65,0x63,0x32,0x66,0x28,0x2d,0x30,0x2e,0x35,0x66,0x29,0x20,0x2a,0x20,0x78,
0x5f,0x35,0x31,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,
0x35,0x36,0x20,0x3d,0x20,0x64,0x6f,0x77,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,
0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x36,0x31,0x20,0x3d,0x20,0x75,
0x76,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x36,0x34,0x20,0x3d,0x20,
0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x20,0x20,
0x6c,0x65,0x74,0x20,0x78,0x5f,0x36,0x37,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,
0x72,0x65,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,
0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x2c,0x20,
0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,
0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x28,0x78,0x5f,0x36,0x31,0x20,0x2b,0x20,0x28,
0x76,0x65,0x63,0x32,0x66,0x28,0x2d,0x30,0x2e,0x35,0x66,0x2c,0x20,0x30,0x2e,0x35,
0x66,0x29,0x20,0x2a,0x20,0x78,0x5f,0x36,0x34,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,
0x6c,0x65,0x74,0x20,0x78,0x5f,0x36,0x39,0x20,0x3d,0x20,0x64,0x6f,0x77,0x6e,0x5f,
0x73,0x61,0x6d,0x70,0x6c,0x65,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,
0x37,0x35,0x20,0x3d,0x20,0x75,0x76,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,
0x5f,0x37,0x37,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x73,0x69,
0x7a,0x65,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x38,0x30,0x20,0x3d,
0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x64,
0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,
0x74,0x75,0x72,0x65,0x2c,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,
0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x28,0x78,0x5f,
0x37,0x35,0x20,0x2b,0x20,0x28,0x76,0x65,0x63,0x32,0x66,0x28,0x30,0x2e,0x35,0x66,
0x2c,0x20,0x2d,0x30,0x2e,0x35,0x66,0x29,0x20,0x2a,0x20,0x78,0x5f,0x37,0x37,0x29,
0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x38,0x32,0x20,0x3d,
0x20,0x64,0x6f,0x77,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x3b,0x0a,0x20,0x20,
0x6c,0x65,0x74,0x20,0x78,0x5f,0x38,0x38,0x20,0x3d,0x20,0x75,0x76,0x3b,0x0a,0x20,
0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x39,0x30,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,
0x75,0x72,0x65,0x5f,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,
0x78,0x5f,0x39,0x33,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x53,0x61,
0x6d,0x70,0x6c,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73, 0x6d,0x70,0x6c,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,
0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x2c,0x20,0x64,0x72,0x61,0x77, 0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x2c,0x20,0x64,0x72,0x61,0x77,
0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65, 0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,
0x72,0x2c,0x20,0x28,0x78,0x5f,0x34,0x38,0x20,0x2b,0x20,0x28,0x76,0x65,0x63,0x32, 0x72,0x2c,0x20,0x28,0x78,0x5f,0x38,0x38,0x20,0x2b,0x20,0x28,0x76,0x65,0x63,0x32,
0x66,0x28,0x2d,0x30,0x2e,0x35,0x66,0x2c,0x20,0x2d,0x30,0x2e,0x35,0x66,0x29,0x20, 0x66,0x28,0x30,0x2e,0x35,0x66,0x29,0x20,0x2a,0x20,0x78,0x5f,0x39,0x30,0x29,0x29,
0x2a,0x20,0x78,0x5f,0x35,0x31,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74, 0x29,0x3b,0x0a,0x20,0x20,0x61,0x6c,0x70,0x68,0x61,0x20,0x3d,0x20,0x28,0x28,0x28,
0x20,0x78,0x5f,0x35,0x36,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x64,0x6f, 0x28,0x78,0x5f,0x35,0x34,0x2e,0x78,0x20,0x2a,0x20,0x78,0x5f,0x35,0x36,0x29,0x20,
0x77,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74, 0x2b,0x20,0x28,0x78,0x5f,0x36,0x37,0x2e,0x78,0x20,0x2a,0x20,0x78,0x5f,0x36,0x39,
0x20,0x78,0x5f,0x36,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20, 0x29,0x29,0x20,0x2b,0x20,0x28,0x78,0x5f,0x38,0x30,0x2e,0x78,0x20,0x2a,0x20,0x78,
0x75,0x76,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x36,0x34,0x20,0x3a, 0x5f,0x38,0x32,0x29,0x29,0x20,0x2b,0x20,0x28,0x78,0x5f,0x39,0x33,0x2e,0x78,0x20,
0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65, 0x2a,0x20,0x64,0x6f,0x77,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x29,0x29,0x3b,
0x5f,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x36, 0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x30,0x35,0x20,0x3d,0x20,0x78,
0x37,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x74,0x65,0x78,0x74, 0x5f,0x33,0x32,0x2e,0x63,0x6f,0x6c,0x6f,0x75,0x72,0x2e,0x78,0x79,0x7a,0x3b,0x0a,
0x75,0x72,0x65,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74, 0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,
0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x2c, 0x65,0x63,0x34,0x66,0x28,0x78,0x5f,0x31,0x30,0x35,0x2e,0x78,0x2c,0x20,0x78,0x5f,
0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x73, 0x31,0x30,0x35,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x31,0x30,0x35,0x2e,0x7a,0x2c,0x20,
0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x28,0x78,0x5f,0x36,0x31,0x20,0x2b,0x20, 0x28,0x78,0x5f,0x33,0x32,0x2e,0x63,0x6f,0x6c,0x6f,0x75,0x72,0x2e,0x77,0x20,0x2a,
0x28,0x76,0x65,0x63,0x32,0x66,0x28,0x2d,0x30,0x2e,0x35,0x66,0x2c,0x20,0x30,0x2e, 0x20,0x61,0x6c,0x70,0x68,0x61,0x29,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,
0x35,0x66,0x29,0x20,0x2a,0x20,0x78,0x5f,0x36,0x34,0x29,0x29,0x29,0x3b,0x0a,0x20, 0x72,0x6e,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,
0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x36,0x39,0x20,0x3a,0x20,0x66,0x33,0x32,0x20, 0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x40,0x6c,0x6f,0x63,0x61,
0x3d,0x20,0x64,0x6f,0x77,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x3b,0x0a,0x20, 0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x0a,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,
0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x37,0x35,0x20,0x3a,0x20,0x76,0x65,0x63,0x32, 0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,
0x66,0x20,0x3d,0x20,0x75,0x76,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, 0x7d,0x0a,0x0a,0x40,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x0a,0x66,0x6e,0x20,
0x37,0x37,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x74,0x65,0x78, 0x6d,0x61,0x69,0x6e,0x28,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,
0x74,0x75,0x72,0x65,0x5f,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74, 0x29,0x20,0x75,0x76,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,
0x20,0x78,0x5f,0x38,0x30,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20, 0x32,0x66,0x29,0x20,0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,
0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x64,0x72, 0x7b,0x0a,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x75,0x76,0x5f,0x70,0x61,0x72,0x61,
0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x74, 0x6d,0x3b,0x0a,0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x3b,0x0a,0x20,
0x75,0x72,0x65,0x2c,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73, 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,
0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,0x28,0x78,0x5f,0x37, 0x28,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x29,0x3b,0x0a,0x7d,0x0a,
0x35,0x20,0x2b,0x20,0x28,0x76,0x65,0x63,0x32,0x66,0x28,0x30,0x2e,0x35,0x66,0x2c, 0x00,
0x20,0x2d,0x30,0x2e,0x35,0x66,0x29,0x20,0x2a,0x20,0x78,0x5f,0x37,0x37,0x29,0x29,
0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x38,0x32,0x20,0x3a,0x20,
0x66,0x33,0x32,0x20,0x3d,0x20,0x64,0x6f,0x77,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,
0x65,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x38,0x38,0x20,0x3a,0x20,
0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x75,0x76,0x3b,0x0a,0x20,0x20,0x6c,0x65,
0x74,0x20,0x78,0x5f,0x39,0x30,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,
0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x73,0x69,0x7a,0x65,0x3b,0x0a,0x20,
0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x39,0x33,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,
0x66,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x53,0x61,0x6d,0x70,0x6c,
0x65,0x28,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,
0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x2c,0x20,0x64,0x72,0x61,0x77,0x5f,0x74,0x65,
0x78,0x74,0x5f,0x73,0x72,0x63,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x2c,0x20,
0x28,0x78,0x5f,0x38,0x38,0x20,0x2b,0x20,0x28,0x76,0x65,0x63,0x32,0x66,0x28,0x30,
0x2e,0x35,0x66,0x2c,0x20,0x30,0x2e,0x35,0x66,0x29,0x20,0x2a,0x20,0x78,0x5f,0x39,
0x30,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x39,0x35,
0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x64,0x6f,0x77,0x6e,0x5f,0x73,0x61,
0x6d,0x70,0x6c,0x65,0x3b,0x0a,0x20,0x20,0x61,0x6c,0x70,0x68,0x61,0x20,0x3d,0x20,
0x28,0x28,0x28,0x28,0x78,0x5f,0x35,0x34,0x2e,0x78,0x20,0x2a,0x20,0x78,0x5f,0x35,
0x36,0x29,0x20,0x2b,0x20,0x28,0x78,0x5f,0x36,0x37,0x2e,0x78,0x20,0x2a,0x20,0x78,
0x5f,0x36,0x39,0x29,0x29,0x20,0x2b,0x20,0x28,0x78,0x5f,0x38,0x30,0x2e,0x78,0x20,
0x2a,0x20,0x78,0x5f,0x38,0x32,0x29,0x29,0x20,0x2b,0x20,0x28,0x78,0x5f,0x39,0x33,
0x2e,0x78,0x20,0x2a,0x20,0x78,0x5f,0x39,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,
0x65,0x74,0x20,0x78,0x5f,0x31,0x30,0x34,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,
0x20,0x3d,0x20,0x78,0x5f,0x33,0x32,0x2e,0x63,0x6f,0x6c,0x6f,0x75,0x72,0x3b,0x0a,
0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x30,0x35,0x20,0x3a,0x20,0x76,0x65,
0x63,0x33,0x66,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x31,0x30,
0x34,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x31,0x30,0x34,0x2e,0x79,0x2c,0x20,0x78,0x5f,
0x31,0x30,0x34,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,
0x31,0x30,0x38,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78,0x5f,0x33,0x32,
0x2e,0x63,0x6f,0x6c,0x6f,0x75,0x72,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,
0x20,0x78,0x5f,0x31,0x30,0x39,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x61,
0x6c,0x70,0x68,0x61,0x3b,0x0a,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,
0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x66,0x28,0x78,0x5f,0x31,0x30,0x35,
0x2e,0x78,0x2c,0x20,0x78,0x5f,0x31,0x30,0x35,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x31,
0x30,0x35,0x2e,0x7a,0x2c,0x20,0x28,0x78,0x5f,0x31,0x30,0x38,0x20,0x2a,0x20,0x78,
0x5f,0x31,0x30,0x39,0x29,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,
0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,
0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,
0x6f,0x6e,0x28,0x30,0x29,0x0a,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,
0x6f,0x72,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x7d,0x0a,
0x0a,0x40,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x0a,0x66,0x6e,0x20,0x6d,0x61,
0x69,0x6e,0x28,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,
0x75,0x76,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,
0x29,0x20,0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,
0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x75,0x76,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,
0x0a,0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x3b,0x0a,0x20,0x20,0x72,
0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x28,0x66,
0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
} }
draw_text_shader_desc :: proc (backend: sg.Backend) -> sg.Shader_Desc { draw_text_shader_desc :: proc (backend: sg.Backend) -> sg.Shader_Desc {
desc: sg.Shader_Desc desc: sg.Shader_Desc

View File

@@ -387,11 +387,8 @@ render_glyph_fs_source_metal_macos := [238]u8 {
var<private> gl_Position : vec4f; var<private> gl_Position : vec4f;
fn main_1() { fn main_1() {
let x_16 : f32 = v_texture.x; uv = vec2f(v_texture.x, (1.0f - v_texture.y));
let x_20 : f32 = v_texture.y; gl_Position = vec4f(v_position.x, v_position.y, 0.0f, 1.0f);
uv = vec2f(x_16, (1.0f - x_20));
let x_31 : vec2f = v_position;
gl_Position = vec4f(x_31.x, x_31.y, 0.0f, 1.0f);
return; return;
} }
@@ -409,10 +406,9 @@ render_glyph_fs_source_metal_macos := [238]u8 {
main_1(); main_1();
return main_out(uv, gl_Position); return main_out(uv, gl_Position);
} }
*/ */
@(private="file") @(private="file")
render_glyph_vs_source_wgsl := [698]u8 { render_glyph_vs_source_wgsl := [626]u8 {
0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20, 0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20,
0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f, 0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f,
0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69, 0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,
@@ -424,39 +420,35 @@ render_glyph_vs_source_wgsl := [698]u8 {
0x63,0x32,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74, 0x63,0x32,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,0x76,0x61,0x74,
0x65,0x3e,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a, 0x65,0x3e,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,
0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e, 0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,
0x5f,0x31,0x28,0x29,0x20,0x7b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31, 0x5f,0x31,0x28,0x29,0x20,0x7b,0x0a,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x76,0x65,
0x36,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x76,0x5f,0x74,0x65,0x78,0x74, 0x63,0x32,0x66,0x28,0x76,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x2e,0x78,0x2c,
0x75,0x72,0x65,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32, 0x20,0x28,0x31,0x2e,0x30,0x66,0x20,0x2d,0x20,0x76,0x5f,0x74,0x65,0x78,0x74,0x75,
0x30,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x76,0x5f,0x74,0x65,0x78,0x74, 0x72,0x65,0x2e,0x79,0x29,0x29,0x3b,0x0a,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,
0x75,0x72,0x65,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x76,0x65, 0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x66,0x28,0x76,0x5f,
0x63,0x32,0x66,0x28,0x78,0x5f,0x31,0x36,0x2c,0x20,0x28,0x31,0x2e,0x30,0x66,0x20, 0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x78,0x2c,0x20,0x76,0x5f,0x70,0x6f,
0x2d,0x20,0x78,0x5f,0x32,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20, 0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2c,0x20,
0x78,0x5f,0x33,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x76, 0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,
0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x67,0x6c,0x5f, 0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x5f,
0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x66, 0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,
0x28,0x78,0x5f,0x33,0x31,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x33,0x31,0x2e,0x79,0x2c, 0x6e,0x28,0x30,0x29,0x0a,0x20,0x20,0x75,0x76,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,
0x20,0x30,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x20,0x20, 0x63,0x32,0x66,0x2c,0x0a,0x20,0x20,0x40,0x62,0x75,0x69,0x6c,0x74,0x69,0x6e,0x28,
0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63, 0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x0a,0x20,0x20,0x67,0x6c,0x5f,0x50,
0x74,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x40, 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,
0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x0a,0x20,0x20,0x75,0x76, 0x0a,0x7d,0x0a,0x0a,0x40,0x76,0x65,0x72,0x74,0x65,0x78,0x0a,0x66,0x6e,0x20,0x6d,
0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x2c,0x0a,0x20,0x20,0x40,0x62, 0x61,0x69,0x6e,0x28,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x31,0x29,
0x75,0x69,0x6c,0x74,0x69,0x6e,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29, 0x20,0x76,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,
0x0a,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3a, 0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x2c,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,
0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x76,0x65,0x72,0x74, 0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,0x76,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,
0x65,0x78,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x28,0x40,0x6c,0x6f,0x63,0x61, 0x6e,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x29,
0x74,0x69,0x6f,0x6e,0x28,0x31,0x29,0x20,0x76,0x5f,0x74,0x65,0x78,0x74,0x75,0x72, 0x20,0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,
0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x2c, 0x20,0x76,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x20,0x3d,0x20,0x76,0x5f,0x74,
0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,0x76,0x5f, 0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,
0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a, 0x76,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x76,0x5f,0x70,
0x20,0x76,0x65,0x63,0x32,0x66,0x29,0x20,0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f, 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,
0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x76,0x5f,0x74,0x65,0x78,0x74,0x75,0x72, 0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,
0x65,0x20,0x3d,0x20,0x76,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x70,0x61, 0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x28,0x75,0x76,0x2c,
0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x76,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f, 0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x7d,
0x6e,0x20,0x3d,0x20,0x76,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x70, 0x0a,0x00,
0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,
0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,
0x6f,0x75,0x74,0x28,0x75,0x76,0x2c,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,
0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
} }
/* /*
diagnostic(off, derivative_uniformity); diagnostic(off, derivative_uniformity);
@@ -466,7 +458,7 @@ render_glyph_vs_source_wgsl := [698]u8 {
var<private> uv : vec2f; var<private> uv : vec2f;
fn main_1() { fn main_1() {
frag_color = vec4f(1.0f, 1.0f, 1.0f, 1.0f); frag_color = vec4f(1.0f);
return; return;
} }
@@ -481,10 +473,9 @@ render_glyph_vs_source_wgsl := [698]u8 {
main_1(); main_1();
return main_out(frag_color); return main_out(frag_color);
} }
*/ */
@(private="file") @(private="file")
render_glyph_fs_source_wgsl := [361]u8 { render_glyph_fs_source_wgsl := [342]u8 {
0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20, 0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20,
0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f, 0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f,
0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69, 0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69,
@@ -493,21 +484,20 @@ render_glyph_fs_source_wgsl := [361]u8 {
0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x75,0x76,0x20,0x3a,0x20,0x76,0x65,0x63, 0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x75,0x76,0x20,0x3a,0x20,0x76,0x65,0x63,
0x32,0x66,0x3b,0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29, 0x32,0x66,0x3b,0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,
0x20,0x7b,0x0a,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20, 0x20,0x7b,0x0a,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,
0x3d,0x20,0x76,0x65,0x63,0x34,0x66,0x28,0x31,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e, 0x3d,0x20,0x76,0x65,0x63,0x34,0x66,0x28,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x20,
0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x3b, 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x72,0x75,
0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74, 0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,
0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a, 0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x0a,0x20,0x20,0x66,
0x20,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x0a,0x20, 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,
0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3a,0x20, 0x63,0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,
0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x66,0x72,0x61,0x67,0x6d, 0x74,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x28,0x40,0x6c,0x6f,0x63,0x61,0x74,
0x65,0x6e,0x74,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x28,0x40,0x6c,0x6f,0x63, 0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,0x75,0x76,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,
0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x20,0x75,0x76,0x5f,0x70,0x61,0x72,0x61, 0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x29,0x20,0x2d,0x3e,0x20,0x6d,0x61,0x69,0x6e,
0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x29,0x20,0x2d,0x3e,0x20,0x6d,0x61, 0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x75,0x76,0x20,0x3d,0x20,0x75,0x76,
0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x75,0x76,0x20,0x3d,0x20, 0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,
0x75,0x76,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x6d,0x61,0x69,0x6e, 0x28,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,
0x5f,0x31,0x28,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d, 0x6e,0x5f,0x6f,0x75,0x74,0x28,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,
0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x28,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, 0x29,0x3b,0x0a,0x7d,0x0a,0x00,
0x6f,0x72,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00,
} }
render_glyph_shader_desc :: proc (backend: sg.Backend) -> sg.Shader_Desc { render_glyph_shader_desc :: proc (backend: sg.Backend) -> sg.Shader_Desc {
desc: sg.Shader_Desc desc: sg.Shader_Desc

1
thirdparty/harfbuzz/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
lib

Binary file not shown.

View File

@@ -4097,11 +4097,11 @@ _SOKOL_PRIVATE void _sapp_macos_frame(void) {
#endif #endif
[_sapp.macos.window center]; [_sapp.macos.window center];
_sapp.valid = true; _sapp.valid = true;
NSApp.activationPolicy = NSApplicationActivationPolicyRegular;
if (_sapp.fullscreen) { if (_sapp.fullscreen) {
/* ^^^ on GL, this already toggles a rendered frame, so set the valid flag before */ /* ^^^ on GL, this already toggles a rendered frame, so set the valid flag before */
[_sapp.macos.window toggleFullScreen:self]; [_sapp.macos.window toggleFullScreen:self];
} }
NSApp.activationPolicy = NSApplicationActivationPolicyRegular;
[NSApp activateIgnoringOtherApps:YES]; [NSApp activateIgnoringOtherApps:YES];
[_sapp.macos.window makeKeyAndOrderFront:nil]; [_sapp.macos.window makeKeyAndOrderFront:nil];
_sapp_macos_update_dimensions(); _sapp_macos_update_dimensions();
@@ -6624,19 +6624,20 @@ _SOKOL_PRIVATE void _sapp_d3d11_create_device_and_swapchain(void) {
#if defined(SOKOL_DEBUG) #if defined(SOKOL_DEBUG)
create_flags |= D3D11_CREATE_DEVICE_DEBUG; create_flags |= D3D11_CREATE_DEVICE_DEBUG;
#endif #endif
D3D_FEATURE_LEVEL feature_level; D3D_FEATURE_LEVEL requested_feature_levels[] = { D3D_FEATURE_LEVEL_11_1, D3D_FEATURE_LEVEL_11_0 };
D3D_FEATURE_LEVEL result_feature_level;
HRESULT hr = D3D11CreateDeviceAndSwapChain( HRESULT hr = D3D11CreateDeviceAndSwapChain(
NULL, /* pAdapter (use default) */ NULL, /* pAdapter (use default) */
D3D_DRIVER_TYPE_HARDWARE, /* DriverType */ D3D_DRIVER_TYPE_HARDWARE, /* DriverType */
NULL, /* Software */ NULL, /* Software */
create_flags, /* Flags */ create_flags, /* Flags */
NULL, /* pFeatureLevels */ requested_feature_levels, /* pFeatureLevels */
0, /* FeatureLevels */ 2, /* FeatureLevels */
D3D11_SDK_VERSION, /* SDKVersion */ D3D11_SDK_VERSION, /* SDKVersion */
sc_desc, /* pSwapChainDesc */ sc_desc, /* pSwapChainDesc */
&_sapp.d3d11.swap_chain, /* ppSwapChain */ &_sapp.d3d11.swap_chain, /* ppSwapChain */
&_sapp.d3d11.device, /* ppDevice */ &_sapp.d3d11.device, /* ppDevice */
&feature_level, /* pFeatureLevel */ &result_feature_level, /* pFeatureLevel */
&_sapp.d3d11.device_context); /* ppImmediateContext */ &_sapp.d3d11.device_context); /* ppImmediateContext */
_SOKOL_UNUSED(hr); _SOKOL_UNUSED(hr);
#if defined(SOKOL_DEBUG) #if defined(SOKOL_DEBUG)
@@ -6657,13 +6658,13 @@ _SOKOL_PRIVATE void _sapp_d3d11_create_device_and_swapchain(void) {
D3D_DRIVER_TYPE_HARDWARE, /* DriverType */ D3D_DRIVER_TYPE_HARDWARE, /* DriverType */
NULL, /* Software */ NULL, /* Software */
create_flags, /* Flags */ create_flags, /* Flags */
NULL, /* pFeatureLevels */ requested_feature_levels, /* pFeatureLevels */
0, /* FeatureLevels */ 2, /* FeatureLevels */
D3D11_SDK_VERSION, /* SDKVersion */ D3D11_SDK_VERSION, /* SDKVersion */
sc_desc, /* pSwapChainDesc */ sc_desc, /* pSwapChainDesc */
&_sapp.d3d11.swap_chain, /* ppSwapChain */ &_sapp.d3d11.swap_chain, /* ppSwapChain */
&_sapp.d3d11.device, /* ppDevice */ &_sapp.d3d11.device, /* ppDevice */
&feature_level, /* pFeatureLevel */ &result_feature_level, /* pFeatureLevel */
&_sapp.d3d11.device_context); /* ppImmediateContext */ &_sapp.d3d11.device_context); /* ppImmediateContext */
} }
#endif #endif
@@ -10829,27 +10830,18 @@ _SOKOL_PRIVATE void _sapp_x11_create_window(Visual* visual, int depth) {
int display_width = DisplayWidth(_sapp.x11.display, _sapp.x11.screen); int display_width = DisplayWidth(_sapp.x11.display, _sapp.x11.screen);
int display_height = DisplayHeight(_sapp.x11.display, _sapp.x11.screen); int display_height = DisplayHeight(_sapp.x11.display, _sapp.x11.screen);
int window_width = _sapp.window_width; int window_width = (int)(_sapp.window_width * _sapp.dpi_scale);
int window_height = _sapp.window_height; int window_height = (int)(_sapp.window_height * _sapp.dpi_scale);
if (0 == window_width) { if (0 == window_width) {
window_width = (display_width * 4) / 5; window_width = (display_width * 4) / 5;
} }
if (0 == window_height) { if (0 == window_height) {
window_height = (display_height * 4) / 5; window_height = (display_height * 4) / 5;
} }
int window_xpos = (display_width - window_width) / 2;
int window_ypos = (display_height - window_height) / 2;
if (window_xpos < 0) {
window_xpos = 0;
}
if (window_ypos < 0) {
window_ypos = 0;
}
_sapp_x11_grab_error_handler(); _sapp_x11_grab_error_handler();
_sapp.x11.window = XCreateWindow(_sapp.x11.display, _sapp.x11.window = XCreateWindow(_sapp.x11.display,
_sapp.x11.root, _sapp.x11.root,
window_xpos, 0, 0,
window_ypos,
(uint32_t)window_width, (uint32_t)window_width,
(uint32_t)window_height, (uint32_t)window_height,
0, /* border width */ 0, /* border width */
@@ -10867,17 +10859,14 @@ _SOKOL_PRIVATE void _sapp_x11_create_window(Visual* visual, int depth) {
}; };
XSetWMProtocols(_sapp.x11.display, _sapp.x11.window, protocols, 1); XSetWMProtocols(_sapp.x11.display, _sapp.x11.window, protocols, 1);
// NOTE: PPosition and PSize are obsolete and ignored
XSizeHints* hints = XAllocSizeHints(); XSizeHints* hints = XAllocSizeHints();
hints->flags = (PWinGravity | PPosition | PSize); hints->flags = PWinGravity;
hints->win_gravity = StaticGravity; hints->win_gravity = CenterGravity;
hints->x = window_xpos;
hints->y = window_ypos;
hints->width = window_width;
hints->height = window_height;
XSetWMNormalHints(_sapp.x11.display, _sapp.x11.window, hints); XSetWMNormalHints(_sapp.x11.display, _sapp.x11.window, hints);
XFree(hints); XFree(hints);
/* announce support for drag'n'drop */ // announce support for drag'n'drop
if (_sapp.drop.enabled) { if (_sapp.drop.enabled) {
const Atom version = _SAPP_X11_XDND_VERSION; const Atom version = _SAPP_X11_XDND_VERSION;
XChangeProperty(_sapp.x11.display, _sapp.x11.window, _sapp.x11.xdnd.XdndAware, XA_ATOM, 32, PropModeReplace, (unsigned char*) &version, 1); XChangeProperty(_sapp.x11.display, _sapp.x11.window, _sapp.x11.xdnd.XdndAware, XA_ATOM, 32, PropModeReplace, (unsigned char*) &version, 1);

View File

@@ -4251,8 +4251,8 @@ static void _sdtx_init_context(sdtx_context ctx_id, const sdtx_context_desc_t* i
sg_buffer_desc vbuf_desc; sg_buffer_desc vbuf_desc;
_sdtx_clear(&vbuf_desc, sizeof(vbuf_desc)); _sdtx_clear(&vbuf_desc, sizeof(vbuf_desc));
vbuf_desc.size = vbuf_size; vbuf_desc.size = vbuf_size;
vbuf_desc.type = SG_BUFFERTYPE_VERTEXBUFFER; vbuf_desc.usage.vertex_buffer = true;
vbuf_desc.usage = SG_USAGE_STREAM; vbuf_desc.usage.stream_update = true;
vbuf_desc.label = "sdtx-vbuf"; vbuf_desc.label = "sdtx-vbuf";
ctx->vbuf = sg_make_buffer(&vbuf_desc); ctx->vbuf = sg_make_buffer(&vbuf_desc);
SOKOL_ASSERT(SG_INVALID_ID != ctx->vbuf.id); SOKOL_ASSERT(SG_INVALID_ID != ctx->vbuf.id);

File diff suppressed because it is too large Load Diff

View File

@@ -3321,8 +3321,8 @@ static void _sgl_init_context(sgl_context ctx_id, const sgl_context_desc_t* in_d
sg_buffer_desc vbuf_desc; sg_buffer_desc vbuf_desc;
_sgl_clear(&vbuf_desc, sizeof(vbuf_desc)); _sgl_clear(&vbuf_desc, sizeof(vbuf_desc));
vbuf_desc.size = (size_t)ctx->vertices.cap * sizeof(_sgl_vertex_t); vbuf_desc.size = (size_t)ctx->vertices.cap * sizeof(_sgl_vertex_t);
vbuf_desc.type = SG_BUFFERTYPE_VERTEXBUFFER; vbuf_desc.usage.vertex_buffer = true;
vbuf_desc.usage = SG_USAGE_STREAM; vbuf_desc.usage.stream_update = true;
vbuf_desc.label = "sgl-vertex-buffer"; vbuf_desc.label = "sgl-vertex-buffer";
ctx->vbuf = sg_make_buffer(&vbuf_desc); ctx->vbuf = sg_make_buffer(&vbuf_desc);
SOKOL_ASSERT(SG_INVALID_ID != ctx->vbuf.id); SOKOL_ASSERT(SG_INVALID_ID != ctx->vbuf.id);

View File

@@ -1355,8 +1355,8 @@ SOKOL_API_IMPL sg_buffer_desc sshape_vertex_buffer_desc(const sshape_buffer_t* b
SOKOL_ASSERT(buf && buf->valid); SOKOL_ASSERT(buf && buf->valid);
sg_buffer_desc desc = { 0 }; sg_buffer_desc desc = { 0 };
if (buf->valid) { if (buf->valid) {
desc.type = SG_BUFFERTYPE_VERTEXBUFFER; desc.usage.vertex_buffer = true;
desc.usage = SG_USAGE_IMMUTABLE; desc.usage.immutable = true;
desc.data.ptr = buf->vertices.buffer.ptr; desc.data.ptr = buf->vertices.buffer.ptr;
desc.data.size = buf->vertices.data_size; desc.data.size = buf->vertices.data_size;
} }
@@ -1367,8 +1367,8 @@ SOKOL_API_IMPL sg_buffer_desc sshape_index_buffer_desc(const sshape_buffer_t* bu
SOKOL_ASSERT(buf && buf->valid); SOKOL_ASSERT(buf && buf->valid);
sg_buffer_desc desc = { 0 }; sg_buffer_desc desc = { 0 };
if (buf->valid) { if (buf->valid) {
desc.type = SG_BUFFERTYPE_INDEXBUFFER; desc.usage.index_buffer = true;
desc.usage = SG_USAGE_IMMUTABLE; desc.usage.immutable = true;
desc.data.ptr = buf->indices.buffer.ptr; desc.data.ptr = buf->indices.buffer.ptr;
desc.data.size = buf->indices.data_size; desc.data.size = buf->indices.data_size;
} }

View File

@@ -114,7 +114,7 @@ package sokol_gfx
}); });
--- create resource objects (at least buffers, shaders and pipelines, --- create resource objects (at least buffers, shaders and pipelines,
and optionally images, samplers and render-pass-attachments): and optionally images, samplers and render/compute-pass-attachments):
sg_buffer sg_make_buffer(const sg_buffer_desc*) sg_buffer sg_make_buffer(const sg_buffer_desc*)
sg_image sg_make_image(const sg_image_desc*) sg_image sg_make_image(const sg_image_desc*)
@@ -148,17 +148,22 @@ package sokol_gfx
sg_begin_pass(&(sg_pass){ .compute = true }); sg_begin_pass(&(sg_pass){ .compute = true });
If the compute pass writes into storage images, provide those as
'storage attachments' via an sg_attachments object:
sg_begin_pass(&(sg_pass){ .compute = true, .attachments = attattachments });
--- set the pipeline state for the next draw call with: --- set the pipeline state for the next draw call with:
sg_apply_pipeline(sg_pipeline pip) sg_apply_pipeline(sg_pipeline pip)
--- fill an sg_bindings struct with the resource bindings for the next --- fill an sg_bindings struct with the resource bindings for the next
draw- or dispatch-call (0..N vertex buffers, 0 or 1 index buffer, 0..N images, draw- or dispatch-call (0..N vertex buffers, 0 or 1 index buffer, 0..N images,
samplers and storage-buffers), and call: samplers and storage-buffers), and call
sg_apply_bindings(const sg_bindings* bindings) sg_apply_bindings(const sg_bindings* bindings)
to update the resource bindings. Note that in a compute pass, no vertex- ...to update the resource bindings. Note that in a compute pass, no vertex-
or index-buffer bindings are allowed and will be rejected by the validation or index-buffer bindings are allowed and will be rejected by the validation
layer. layer.
@@ -239,7 +244,7 @@ package sokol_gfx
sg_update_image(sg_image img, const sg_image_data* data) sg_update_image(sg_image img, const sg_image_data* data)
Buffers and images to be updated must have been created with Buffers and images to be updated must have been created with
SG_USAGE_DYNAMIC or SG_USAGE_STREAM. sg_buffer_desc.usage.dynamic_update or .stream_update.
Only one update per frame is allowed for buffer and image resources when Only one update per frame is allowed for buffer and image resources when
using the sg_update_*() functions. The rationale is to have a simple using the sg_update_*() functions. The rationale is to have a simple
@@ -278,7 +283,7 @@ package sokol_gfx
} }
A buffer to be used with sg_append_buffer() must have been created A buffer to be used with sg_append_buffer() must have been created
with SG_USAGE_DYNAMIC or SG_USAGE_STREAM. with sg_buffer_desc.usage.dynamic_update or .stream_update.
If the application appends more data to the buffer then fits into If the application appends more data to the buffer then fits into
the buffer, the buffer will go into the "overflow" state for the the buffer, the buffer will go into the "overflow" state for the
@@ -396,7 +401,7 @@ package sokol_gfx
This is why calling sg_query_surface_pitch() for a compressed pixel format and height This is why calling sg_query_surface_pitch() for a compressed pixel format and height
N, N+1, N+2, ... may return the same result. N, N+1, N+2, ... may return the same result.
The row_align_bytes parammeter is for added flexibility. For image data that goes into The row_align_bytes parameter is for added flexibility. For image data that goes into
the sg_make_image() or sg_update_image() this should generally be 1, because these the sg_make_image() or sg_update_image() this should generally be 1, because these
functions take tightly packed image data as input no matter what alignment restrictions functions take tightly packed image data as input no matter what alignment restrictions
exist in the backend 3D APIs. exist in the backend 3D APIs.
@@ -702,10 +707,11 @@ package sokol_gfx
ON COMPUTE PASSES ON COMPUTE PASSES
================= =================
Compute passes are used to update the content of storage resources Compute passes are used to update the content of storage buffers and
(currently only storage buffers) by running compute shader code on storage images by running compute shader code on
the GPU. This will almost always be more efficient than computing the GPU. Updating storage resources with a compute shader will almost always
that same data on the CPU and uploading the data via `sg_update_buffer()`. be more efficient than computing the same data on the CPU and then uploading
it via `sg_update_buffer()` or `sg_update_image()`.
NOTE: compute passes are only supported on the following platforms and NOTE: compute passes are only supported on the following platforms and
backends: backends:
@@ -724,33 +730,49 @@ package sokol_gfx
- iOS with GLES3 - iOS with GLES3
- Web with WebGL2 - Web with WebGL2
A compute pass is started with: A compute pass which only updates storage buffers is started with:
sg_begin_pass(&(sg_pass){ .compute = true }); sg_begin_pass(&(sg_pass){ .compute = true });
...and finished with: ...if the compute pass updates storage images, the images must be 'bound'
via an sg_attachments object:
sg_begin_pass(&(sg_pass){ .compute = true, .attachments = attachments });
Image objects in such a compute pass attachments object must be created with
`storage_attachment` usage:
sg_image storage_image = sg_make_image(&(sg_image_desc){
.usage = {
.storage_attachment = true,
},
// ...
});
...a compute pass is finished with a regular:
sg_end_pass(); sg_end_pass();
Typically the following functions will be called inside a compute pass: Typically the following functions will be called inside a compute pass:
sg_apply_pipeline sg_apply_pipeline()
sg_apply_bindings sg_apply_bindings()
sg_apply_uniforms sg_apply_uniforms()
sg_dispatch sg_dispatch()
The following functions are disallowed inside a compute pass The following functions are disallowed inside a compute pass
and will cause validation layer errors: and will cause validation layer errors:
sg_apply_viewport[f] sg_apply_viewport[f]()
sg_apply_scissor_rect[f] sg_apply_scissor_rect[f]()
sg_draw sg_draw()
Only special 'compute shaders' and 'compute pipelines' can be used in Only special 'compute shaders' and 'compute pipelines' can be used in
compute passes. A compute shader only has a compute-function instead compute passes. A compute shader only has a compute-function instead
of a vertex- and fragment-function pair, and it doesn't accept vertex- of a vertex- and fragment-function pair, and it doesn't accept vertex-
and index-buffers as input, only storage-buffers, textures and non-filtering and index-buffers as input, only storage-buffers, textures, non-filtering
samplers (more details on compute shaders in the following section). samplers and images via storage attachments (more details on compute shaders in
the following section).
A compute pipeline is created by providing a compute shader object, A compute pipeline is created by providing a compute shader object,
setting the .compute creation parameter to true and not defining any setting the .compute creation parameter to true and not defining any
@@ -774,6 +796,7 @@ package sokol_gfx
- https://floooh.github.io/sokol-webgpu/instancing-compute-sapp.html - https://floooh.github.io/sokol-webgpu/instancing-compute-sapp.html
- https://floooh.github.io/sokol-webgpu/computeboids-sapp.html - https://floooh.github.io/sokol-webgpu/computeboids-sapp.html
- https://floooh.github.io/sokol-webgpu/imageblur-sapp.html
ON SHADER CREATION ON SHADER CREATION
@@ -787,7 +810,8 @@ package sokol_gfx
The easiest way to provide all this shader creation data is to use the The easiest way to provide all this shader creation data is to use the
sokol-shdc shader compiler tool to compile shaders from a common sokol-shdc shader compiler tool to compile shaders from a common
GLSL syntax into backend-specific sources or binary blobs, along with GLSL syntax into backend-specific sources or binary blobs, along with
shader interface information and uniform blocks mapped to C structs. shader interface information and uniform blocks and storage buffer array items
mapped to C structs.
To create a shader using a C header which has been code-generated by sokol-shdc: To create a shader using a C header which has been code-generated by sokol-shdc:
@@ -816,7 +840,9 @@ package sokol_gfx
- for the desktop GL backend, source code can be provided in '#version 410' or - for the desktop GL backend, source code can be provided in '#version 410' or
'#version 430', version 430 is required when using storage buffers and '#version 430', version 430 is required when using storage buffers and
compute shaders support, but note that this is not available on macOS compute shaders support, but note that this is not available on macOS
- for the GLES3 backend, source code must be provided in '#version 300 es' syntax - for the GLES3 backend, source code must be provided in '#version 300 es' or
'#version 310 es' syntax (version 310 is required for storage buffer and
compute shader support, but note that this is not supported on WebGL2)
- for the D3D11 backend, shaders can be provided as source or binary - for the D3D11 backend, shaders can be provided as source or binary
blobs, the source code should be in HLSL4.0 (for compatibility with old blobs, the source code should be in HLSL4.0 (for compatibility with old
low-end GPUs) or preferably in HLSL5.0 syntax, note that when low-end GPUs) or preferably in HLSL5.0 syntax, note that when
@@ -863,7 +889,7 @@ package sokol_gfx
.mtl_threads_per_threadgroup = { .x = 64, .y = 1, .z = 1 }, .mtl_threads_per_threadgroup = { .x = 64, .y = 1, .z = 1 },
} }
- Information about each uniform block used in the shader: - Information about each uniform block binding used in the shader:
- the shader stage of the uniform block (vertex, fragment or compute) - the shader stage of the uniform block (vertex, fragment or compute)
- the size of the uniform block in number of bytes - the size of the uniform block in number of bytes
- a memory layout hint (currently 'native' or 'std140') where 'native' defines a - a memory layout hint (currently 'native' or 'std140') where 'native' defines a
@@ -879,7 +905,7 @@ package sokol_gfx
- please also NOTE the documentation sections about UNIFORM DATA LAYOUT - please also NOTE the documentation sections about UNIFORM DATA LAYOUT
and CROSS-BACKEND COMMON UNIFORM DATA LAYOUT below! and CROSS-BACKEND COMMON UNIFORM DATA LAYOUT below!
- A description of each storage buffer used in the shader: - A description of each storage buffer binding used in the shader:
- the shader stage of the storage buffer - the shader stage of the storage buffer
- a boolean 'readonly' flag, this is used for validation and hazard - a boolean 'readonly' flag, this is used for validation and hazard
tracking in some 3D backends. Note that in render passes, only tracking in some 3D backends. Note that in render passes, only
@@ -893,15 +919,41 @@ package sokol_gfx
buffers and textures share the same bind space for buffers and textures share the same bind space for
'shader resource views') 'shader resource views')
- for read/write storage buffer buffer bindings: the UAV register N - for read/write storage buffer buffer bindings: the UAV register N
(`register(uN)`) where N is 0..7 (in HLSL, readwrite storage (`register(uN)`) where N is 0..11 (in HLSL, readwrite storage
buffers use their own bind space for 'unordered access views') buffers use their own bind space for 'unordered access views')
- Metal/MSL: the buffer bind slot N (`[[buffer(N)]]`) where N is 8..15 - Metal/MSL: the buffer bind slot N (`[[buffer(N)]]`) where N is 8..15
- WebGPU/WGSL: the binding N in `@group(0) @binding(N)` where N is 0..127 - WebGPU/WGSL: the binding N in `@group(0) @binding(N)` where N is 0..127
- GL/GLSL: the buffer binding N in `layout(binding=N)` where N is 0..7 - GL/GLSL: the buffer binding N in `layout(binding=N)` where N is 0..7
- note that storage buffers are not supported on all backends - note that storage buffer bindings are not supported on all backends
and platforms and platforms
- A description of each texture/image used in the shader: - A description of each storage image binding used in the shader (only supported
in compute shaders):
- the shader stage (*must* be compute)
- the expected image type:
- SG_IMAGETYPE_2D
- SG_IMAGETYPE_CUBE
- SG_IMAGETYPE_3D
- SG_IMAGETYPE_ARRAY
- the 'access pixel format', this is currently limited to:
- SG_PIXELFORMAT_RGBA8
- SG_PIXELFORMAT_RGBA8SN/UI/SI
- SG_PIXELFORMAT_RGBA16UI/SI/F
- SG_PIXELFORMAT_R32UIUI/SI/F
- SG_PIXELFORMAT_RG32UI/SI/F
- SG_PIXELFORMAT_RGBA32UI/SI/F
- the access type (readwrite or writeonly)
- a backend-specific bind slot:
- D3D11/HLSL: the UAV register N (`register(uN)` where N is 0..11, the
bind slot must not collide with UAV storage buffer bindings
- Metal/MSL: the texture bind slot N (`[[texture(N)]])` where N is 0..19,
the bind slot must not collide with other texture bindings on the same
stage
- WebGPU/WGSL: the binding N in `@group(2) @binding(N)` where N is 0..3
- GL/GLSL: the buffer binding N in `layout(binding=N)` where N is 0..3
- note that storage image bindings are not supported on all backends and platforms
- A description of each texture binding used in the shader:
- the shader stage of the texture (vertex, fragment or compute) - the shader stage of the texture (vertex, fragment or compute)
- the expected image type: - the expected image type:
- SG_IMAGETYPE_2D - SG_IMAGETYPE_2D
@@ -918,7 +970,8 @@ package sokol_gfx
- a backend-specific bind slot: - a backend-specific bind slot:
- D3D11/HLSL: the texture register N (`register(tN)`) where N is 0..23 - D3D11/HLSL: the texture register N (`register(tN)`) where N is 0..23
(in HLSL, readonly storage buffers and texture share the same bind space) (in HLSL, readonly storage buffers and texture share the same bind space)
- Metal/MSL: the texture bind slot N (`[[texture(N)]]`) where N is 0..15 - Metal/MSL: the texture bind slot N (`[[texture(N)]]`) where N is 0..19
(the bind slot must not collide with storage image bindings on the same stage)
- WebGPU/WGSL: the binding N in `@group(0) @binding(N)` where N is 0..127 - WebGPU/WGSL: the binding N in `@group(0) @binding(N)` where N is 0..127
- A description of each sampler used in the shader: - A description of each sampler used in the shader:
@@ -953,24 +1006,26 @@ package sokol_gfx
- D3D11/HLSL: - D3D11/HLSL:
- separate bindslot space per shader stage - separate bindslot space per shader stage
- uniform blocks (as cbuffer): `register(b0..b7)` - uniform block bindings (as cbuffer): `register(b0..b7)`
- textures and readonly storage buffers: `register(t0..t23)` - texture- and readonly storage buffer bindings: `register(t0..t23)`
- read/write storage buffers: `register(u0..u7)` - read/write storage buffer and storage image bindings: `register(u0..u11)`
- samplers: `register(s0..s15)` - samplers: `register(s0..s15)`
- Metal/MSL: - Metal/MSL:
- separate bindslot space per shader stage - separate bindslot space per shader stage
- uniform blocks: `[[buffer(0..7)]]` - uniform blocks: `[[buffer(0..7)]]`
- storage buffers: `[[buffer(8..15)]]` - storage buffers: `[[buffer(8..15)]]`
- textures: `[[texture(0..15)]]` - textures and storage image bindings: `[[texture(0..19)]]`
- samplers: `[[sampler(0..15)]]` - samplers: `[[sampler(0..15)]]`
- WebGPU/WGSL: - WebGPU/WGSL:
- common bindslot space across shader stages - common bindslot space across shader stages
- uniform blocks: `@group(0) @binding(0..15)` - uniform blocks: `@group(0) @binding(0..15)`
- textures, samplers and storage buffers: `@group(1) @binding(0..127)` - textures, samplers and storage buffers: `@group(1) @binding(0..127)`
- storage image bindings: `@group(2) @binding(0..3)`
- GL/GLSL: - GL/GLSL:
- uniforms and image-samplers are bound by name - uniforms and image-samplers are bound by name
- storage buffers: `layout(std430, binding=0..7)` (common - storage buffer bindings: `layout(std430, binding=0..7)` (common
bindslot space across shader stages) bindslot space across shader stages)
- storage image bindings: `layout(binding=0..3, [access_format])`
For example code of how to create backend-specific shader objects, For example code of how to create backend-specific shader objects,
please refer to the following samples: please refer to the following samples:
@@ -1194,7 +1249,7 @@ package sokol_gfx
can only read from storage buffers, while compute-shaders can both read can only read from storage buffers, while compute-shaders can both read
and write storage buffers) and write storage buffers)
- create one or more storage buffers via sg_make_buffer() with the - create one or more storage buffers via sg_make_buffer() with the
buffer type SG_BUFFERTYPE_STORAGEBUFFER `.usage.storage_buffer = true`
- when creating a shader via sg_make_shader(), populate the sg_shader_desc - when creating a shader via sg_make_shader(), populate the sg_shader_desc
struct with binding info (when using sokol-shdc, this step will be taken care struct with binding info (when using sokol-shdc, this step will be taken care
of automatically) of automatically)
@@ -1305,8 +1360,8 @@ package sokol_gfx
(https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/sm5-object-rwbyteaddressbuffer) (https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/sm5-object-rwbyteaddressbuffer)
- readonly-storage buffers and textures are both bound as 'shader-resource-view' and - readonly-storage buffers and textures are both bound as 'shader-resource-view' and
share the same bind slots (declared as `register(tN)` in HLSL), where N must be in the range 0..23) share the same bind slots (declared as `register(tN)` in HLSL), where N must be in the range 0..23)
- read/write storage buffers are bound as 'unordered-access-view' (declared as `register(uN)` in HLSL - read/write storage buffers and storage images are bound as 'unordered-access-view'
where N is in the range 0..7) (declared as `register(uN)` in HLSL where N is in the range 0..11)
Metal: Metal:
- in Metal there is no internal difference between vertex-, uniform- and - in Metal there is no internal difference between vertex-, uniform- and
@@ -1333,6 +1388,53 @@ package sokol_gfx
`@group(1) @binding(0..127) `@group(1) @binding(0..127)
ON STORAGE IMAGES:
==================
To write pixel data to texture objects in compute shaders, first an image
object must be created with `storage_attachment usage`:
sg_image storage_image = sg_make_image(&(sg_image_desc){
.usage = {
.storage_attachment = true,
},
.width = ...,
.height = ...,
.pixel_format = ...,
});
...next the image object must be wrapped in an attachment object, this allows
to pick a specific mipmap level or slice to be accessed by the compute shader:
sg_attachments storage_attachment = sg_make_attachment(&(sg_attachments_desc){
.storages[0] = {
.image = storage_image,
.mip_level = ...,
.slice = ...,
},
});
Finally 'bind' the storage image as pass attachment in the `sg_begin_pass`
call of a compute pass:
sg_begin_pass(&(sg_pass){ .compute = true, .attachments = storage_attachments });
...
sg_end_pass();
Storage attachments should only be accessed as `readwrite` or `writeonly` mode
in compute shaders because if the limited bind space of up to 4 slots. For
readonly access, just bind the storage image as regular texture via
`sg_apply_bindings()`.
For an example of using storage images in compute shaders see imageblur-sapp:
- C code: https://github.com/floooh/sokol-samples/blob/master/sapp/imageblur-sapp.c
- shader: https://github.com/floooh/sokol-samples/blob/master/sapp/imageblur-sapp.glsl
NOTE: in the (hopefully not-too-distant) future, working with storage
images will change by moving the resource binding from pass attachments to
regular bindings via `sg_apply_bindings()`, but this requires the
introduction of resource view objects into sokol-gfx (see planning
ticket: https://github.com/floooh/sokol/issues/1252)
TRACE HOOKS: TRACE HOOKS:
============ ============
@@ -1667,6 +1769,11 @@ package sokol_gfx
@group(1) @binding(0..127) @group(1) @binding(0..127)
All storage image attachments must use `@group(2)` and bindings
must be in the range 0..3:
@group(2) @binding(0..3)
Note that the number of texture, sampler and storage buffer bindings Note that the number of texture, sampler and storage buffer bindings
is still limited despite the large bind range: is still limited despite the large bind range:
@@ -1721,7 +1828,7 @@ package sokol_gfx
- Likewise, the following sokol-gfx pixel formats are not supported in WebGPU: - Likewise, the following sokol-gfx pixel formats are not supported in WebGPU:
R16, R16SN, RG16, RG16SN, RGBA16, RGBA16SN. R16, R16SN, RG16, RG16SN, RGBA16, RGBA16SN.
Unlike unsupported vertex formats, unsupported pixel formats can be queried Unlike unsupported vertex formats, unsupported pixel formats can be queried
in cross-backend code via sg_query_pixel_format() though. in cross-backend code via sg_query_pixelformat() though.
- The Emscripten WebGPU shim currently doesn't support the Closure minification - The Emscripten WebGPU shim currently doesn't support the Closure minification
post-link-step (e.g. currently the emcc argument '--closure 1' or '--closure 2' post-link-step (e.g. currently the emcc argument '--closure 1' or '--closure 2'
@@ -1913,15 +2020,14 @@ foreign sokol_gfx_clib {
query_attachments_defaults :: proc(#by_ptr desc: Attachments_Desc) -> Attachments_Desc --- query_attachments_defaults :: proc(#by_ptr desc: Attachments_Desc) -> Attachments_Desc ---
// assorted query functions // assorted query functions
query_buffer_size :: proc(buf: Buffer) -> c.size_t --- query_buffer_size :: proc(buf: Buffer) -> c.size_t ---
query_buffer_type :: proc(buf: Buffer) -> Buffer_Type --- query_buffer_usage :: proc(buf: Buffer) -> Buffer_Usage ---
query_buffer_usage :: proc(buf: Buffer) -> Usage ---
query_image_type :: proc(img: Image) -> Image_Type --- query_image_type :: proc(img: Image) -> Image_Type ---
query_image_width :: proc(img: Image) -> c.int --- query_image_width :: proc(img: Image) -> c.int ---
query_image_height :: proc(img: Image) -> c.int --- query_image_height :: proc(img: Image) -> c.int ---
query_image_num_slices :: proc(img: Image) -> c.int --- query_image_num_slices :: proc(img: Image) -> c.int ---
query_image_num_mipmaps :: proc(img: Image) -> c.int --- query_image_num_mipmaps :: proc(img: Image) -> c.int ---
query_image_pixelformat :: proc(img: Image) -> Pixel_Format --- query_image_pixelformat :: proc(img: Image) -> Pixel_Format ---
query_image_usage :: proc(img: Image) -> Usage --- query_image_usage :: proc(img: Image) -> Image_Usage ---
query_image_sample_count :: proc(img: Image) -> c.int --- query_image_sample_count :: proc(img: Image) -> c.int ---
// separate resource allocation and initialization (for async setup) // separate resource allocation and initialization (for async setup)
alloc_buffer :: proc() -> Buffer --- alloc_buffer :: proc() -> Buffer ---
@@ -2087,6 +2193,7 @@ Range :: struct {
INVALID_ID :: 0 INVALID_ID :: 0
NUM_INFLIGHT_FRAMES :: 2 NUM_INFLIGHT_FRAMES :: 2
MAX_COLOR_ATTACHMENTS :: 4 MAX_COLOR_ATTACHMENTS :: 4
MAX_STORAGE_ATTACHMENTS :: 4
MAX_UNIFORMBLOCK_MEMBERS :: 16 MAX_UNIFORMBLOCK_MEMBERS :: 16
MAX_VERTEX_ATTRIBUTES :: 16 MAX_VERTEX_ATTRIBUTES :: 16
MAX_MIPMAPS :: 16 MAX_MIPMAPS :: 16
@@ -2249,6 +2356,8 @@ Pixelformat_Info :: struct {
msaa : bool, msaa : bool,
depth : bool, depth : bool,
compressed : bool, compressed : bool,
read : bool,
write : bool,
bytes_per_pixel : c.int, bytes_per_pixel : c.int,
} }
@@ -2260,6 +2369,7 @@ Features :: struct {
mrt_independent_write_mask : bool, mrt_independent_write_mask : bool,
compute : bool, compute : bool,
msaa_image_bindings : bool, msaa_image_bindings : bool,
separate_buffer_types : bool,
} }
// Runtime information about resource limits, returned by sg_query_limit() // Runtime information about resource limits, returned by sg_query_limit()
@@ -2300,64 +2410,6 @@ Resource_State :: enum i32 {
INVALID, INVALID,
} }
/*
sg_usage
A resource usage hint describing the update strategy of
buffers and images. This is used in the sg_buffer_desc.usage
and sg_image_desc.usage members when creating buffers
and images:
SG_USAGE_IMMUTABLE: the resource will never be updated with
new (CPU-side) data, instead the content of the
resource must be provided on creation
SG_USAGE_DYNAMIC: the resource will be updated infrequently
with new data (this could range from "once
after creation", to "quite often but not
every frame")
SG_USAGE_STREAM: the resource will be updated each frame
with new content
The rendering backends use this hint to prevent that the
CPU needs to wait for the GPU when attempting to update
a resource that might be currently accessed by the GPU.
Resource content is updated with the functions sg_update_buffer() or
sg_append_buffer() for buffer objects, and sg_update_image() for image
objects. For the sg_update_*() functions, only one update is allowed per
frame and resource object, while sg_append_buffer() can be called
multiple times per frame on the same buffer. The application must update
all data required for rendering (this means that the update data can be
smaller than the resource size, if only a part of the overall resource
size is used for rendering, you only need to make sure that the data that
*is* used is valid).
The default usage is SG_USAGE_IMMUTABLE.
*/
Usage :: enum i32 {
DEFAULT,
IMMUTABLE,
DYNAMIC,
STREAM,
}
/*
sg_buffer_type
Indicates whether a buffer will be bound as vertex-,
index- or storage-buffer.
Used in the sg_buffer_desc.type member when creating a buffer.
The default value is SG_BUFFERTYPE_VERTEXBUFFER.
*/
Buffer_Type :: enum i32 {
DEFAULT,
VERTEXBUFFER,
INDEXBUFFER,
STORAGEBUFFER,
}
/* /*
sg_index_type sg_index_type
@@ -3163,19 +3215,45 @@ Bindings :: struct {
_ : u32, _ : u32,
} }
/*
sg_buffer_usage
Describes how a buffer object is going to be used:
.vertex_buffer (default: true)
the buffer will bound as vertex buffer via sg_bindings.vertex_buffers[]
.index_buffer (default: false)
the buffer will bound as index buffer via sg_bindings.index_buffer
.storage_buffer (default: false)
the buffer will bound as storage buffer via sg_bindings.storage_buffers[]
.immutable (default: true)
the buffer content will never be updated from the CPU side (but
may be written to by a compute shader)
.dynamic_update (default: false)
the buffer content will be infrequently updated from the CPU side
.stream_upate (default: false)
the buffer content will be updated each frame from the CPU side
*/
Buffer_Usage :: struct {
vertex_buffer : bool,
index_buffer : bool,
storage_buffer : bool,
immutable : bool,
dynamic_update : bool,
stream_update : bool,
}
/* /*
sg_buffer_desc sg_buffer_desc
Creation parameters for sg_buffer objects, used in the Creation parameters for sg_buffer objects, used in the sg_make_buffer() call.
sg_make_buffer() call.
The default configuration is: The default configuration is:
.size: 0 (*must* be >0 for buffers without data) .size: 0 (*must* be >0 for buffers without data)
.type: SG_BUFFERTYPE_VERTEXBUFFER .usage .vertex_buffer = true, .immutable = true
.usage: SG_USAGE_IMMUTABLE .data.ptr 0 (*must* be valid for immutable buffers without storage buffer usage)
.data.ptr 0 (*must* be valid for immutable buffers) .data.size 0 (*must* be > 0 for immutable buffers without storage buffer usage)
.data.size 0 (*must* be > 0 for immutable buffers)
.label 0 (optional string label) .label 0 (optional string label)
For immutable buffers which are initialized with initial data, For immutable buffers which are initialized with initial data,
@@ -3185,14 +3263,18 @@ Bindings :: struct {
For immutable or mutable buffers without initial data, keep the .data item For immutable or mutable buffers without initial data, keep the .data item
zero-initialized, and set the buffer size in the .size item instead. zero-initialized, and set the buffer size in the .size item instead.
NOTE: Immutable buffers without initial data are guaranteed to be
zero-initialized. For mutable (dynamic or streaming) buffers, the
initial content is undefined.
You can also set both size values, but currently both size values must You can also set both size values, but currently both size values must
be identical (this may change in the future when the dynamic resource be identical (this may change in the future when the dynamic resource
management may become more flexible). management may become more flexible).
NOTE: Immutable buffers without storage-buffer-usage *must* be created
with initial content, this restriction doesn't apply to storage buffer usage,
because storage buffers may also get their initial content by running
a compute shader on them.
NOTE: Buffers without initial data will have undefined content, e.g.
do *not* expect the buffer to be zero-initialized!
ADVANCED TOPIC: Injecting native 3D-API buffers: ADVANCED TOPIC: Injecting native 3D-API buffers:
The following struct members allow to inject your own GL, Metal The following struct members allow to inject your own GL, Metal
@@ -3203,12 +3285,12 @@ Bindings :: struct {
.d3d11_buffer .d3d11_buffer
You must still provide all other struct items except the .data item, and You must still provide all other struct items except the .data item, and
these must match the creation parameters of the native buffers you these must match the creation parameters of the native buffers you provide.
provide. For SG_USAGE_IMMUTABLE, only provide a single native 3D-API For sg_buffer_desc.usage.immutable buffers, only provide a single native
buffer, otherwise you need to provide SG_NUM_INFLIGHT_FRAMES buffers 3D-API buffer, otherwise you need to provide SG_NUM_INFLIGHT_FRAMES buffers
(only for GL and Metal, not D3D11). Providing multiple buffers for GL and (only for GL and Metal, not D3D11). Providing multiple buffers for GL and
Metal is necessary because sokol_gfx will rotate through them when Metal is necessary because sokol_gfx will rotate through them when calling
calling sg_update_buffer() to prevent lock-stalls. sg_update_buffer() to prevent lock-stalls.
Note that it is expected that immutable injected buffer have already been Note that it is expected that immutable injected buffer have already been
initialized with content, and the .content member must be 0! initialized with content, and the .content member must be 0!
@@ -3219,8 +3301,7 @@ Bindings :: struct {
Buffer_Desc :: struct { Buffer_Desc :: struct {
_ : u32, _ : u32,
size : c.size_t, size : c.size_t,
type : Buffer_Type, usage : Buffer_Usage,
usage : Usage,
data : Range, data : Range,
label : cstring, label : cstring,
gl_buffers : [2]u32, gl_buffers : [2]u32,
@@ -3230,6 +3311,35 @@ Buffer_Desc :: struct {
_ : u32, _ : u32,
} }
/*
sg_image_usage
Describes how the image object is going to be used:
.render_attachment (default: false)
the image object is used as color-, resolve- or depth-stencil-
attachment in a render pass
.storage_attachment (default: false)
the image object is used as storage-attachment in a
compute pass (to be written to by compute shaders)
.immutable (default: true)
the image content cannot be updated from the CPU side
(but may be updated by the GPU in a render- or compute-pass)
.dynamic_update (default: false)
the image content is updated infrequently by the CPU
.stream_update (default: false)
the image content is updated each frame by the CPU via
Note that the usage as texture binding is implicit and always allowed.
*/
Image_Usage :: struct {
render_attachment : bool,
storage_attachment : bool,
immutable : bool,
dynamic_update : bool,
stream_update : bool,
}
/* /*
sg_image_data sg_image_data
@@ -3248,15 +3358,14 @@ Image_Data :: struct {
The default configuration is: The default configuration is:
.type: SG_IMAGETYPE_2D .type SG_IMAGETYPE_2D
.render_target: false .usage .immutable = true
.width 0 (must be set to >0) .width 0 (must be set to >0)
.height 0 (must be set to >0) .height 0 (must be set to >0)
.num_slices 1 (3D textures: depth; array textures: number of layers) .num_slices 1 (3D textures: depth; array textures: number of layers)
.num_mipmaps: 1 .num_mipmaps 1
.usage: SG_USAGE_IMMUTABLE .pixel_format SG_PIXELFORMAT_RGBA8 for textures, or sg_desc.environment.defaults.color_format for render targets
.pixel_format: SG_PIXELFORMAT_RGBA8 for textures, or sg_desc.environment.defaults.color_format for render targets .sample_count 1 for textures, or sg_desc.environment.defaults.sample_count for render targets
.sample_count: 1 for textures, or sg_desc.environment.defaults.sample_count for render targets
.data an sg_image_data struct to define the initial content .data an sg_image_data struct to define the initial content
.label 0 (optional string label for trace hooks) .label 0 (optional string label for trace hooks)
@@ -3271,9 +3380,13 @@ Image_Data :: struct {
NOTE: NOTE:
Images with usage SG_USAGE_IMMUTABLE must be fully initialized by Regular (non-attachment) images with usage.immutable must be fully initialized by
providing a valid .data member which points to initialization data. providing a valid .data member which points to initialization data.
Images with usage.render_attachment or usage.storage_attachment must
*not* be created with initial content. Be aware that the initial
content of render- and storage-attachment images is undefined.
ADVANCED TOPIC: Injecting native 3D-API textures: ADVANCED TOPIC: Injecting native 3D-API textures:
The following struct members allow to inject your own GL, Metal or D3D11 The following struct members allow to inject your own GL, Metal or D3D11
@@ -3300,12 +3413,11 @@ Image_Data :: struct {
Image_Desc :: struct { Image_Desc :: struct {
_ : u32, _ : u32,
type : Image_Type, type : Image_Type,
render_target : bool, usage : Image_Usage,
width : c.int, width : c.int,
height : c.int, height : c.int,
num_slices : c.int, num_slices : c.int,
num_mipmaps : c.int, num_mipmaps : c.int,
usage : Usage,
pixel_format : Pixel_Format, pixel_format : Pixel_Format,
sample_count : c.int, sample_count : c.int,
data : Image_Data, data : Image_Data,
@@ -3366,7 +3478,7 @@ Sampler_Desc :: struct {
reflection information to sokol-gfx. reflection information to sokol-gfx.
If you use sokol-shdc you can ignore the following information since If you use sokol-shdc you can ignore the following information since
the sg_shader_desc struct will be code generated. the sg_shader_desc struct will be code-generated.
Otherwise you need to provide the following information to the Otherwise you need to provide the following information to the
sg_make_shader() call: sg_make_shader() call:
@@ -3401,7 +3513,7 @@ Sampler_Desc :: struct {
- WGSL: `@workgroup_size(x, y, z)` - WGSL: `@workgroup_size(x, y, z)`
...but in Metal the workgroup size is declared on the CPU side ...but in Metal the workgroup size is declared on the CPU side
- reflection information for each uniform block used by the shader: - reflection information for each uniform block binding used by the shader:
- the shader stage the uniform block appears in (SG_SHADERSTAGE_*) - the shader stage the uniform block appears in (SG_SHADERSTAGE_*)
- the size in bytes of the uniform block - the size in bytes of the uniform block
- backend-specific bindslots: - backend-specific bindslots:
@@ -3415,14 +3527,14 @@ Sampler_Desc :: struct {
- if the member is an array, the array count - if the member is an array, the array count
- the member name - the member name
- reflection information for each texture used by the shader: - reflection information for each texture binding used by the shader:
- the shader stage the texture appears in (SG_SHADERSTAGE_*) - the shader stage the texture appears in (SG_SHADERSTAGE_*)
- the image type (SG_IMAGETYPE_*) - the image type (SG_IMAGETYPE_*)
- the image-sample type (SG_IMAGESAMPLETYPE_*) - the image-sample type (SG_IMAGESAMPLETYPE_*)
- whether the texture is multisampled - whether the texture is multisampled
- backend specific bindslots: - backend specific bindslots:
- HLSL: the texture register `register(t0..23)` - HLSL: the texture register `register(t0..23)`
- MSL: the texture attribute `[[texture(0..15)]]` - MSL: the texture attribute `[[texture(0..19)]]`
- WGSL: the binding in `@group(1) @binding(0..127)` - WGSL: the binding in `@group(1) @binding(0..127)`
- reflection information for each sampler used by the shader: - reflection information for each sampler used by the shader:
@@ -3433,18 +3545,31 @@ Sampler_Desc :: struct {
- MSL: the sampler attribute `[[sampler(0..15)]]` - MSL: the sampler attribute `[[sampler(0..15)]]`
- WGSL: the binding in `@group(0) @binding(0..127)` - WGSL: the binding in `@group(0) @binding(0..127)`
- reflection information for each storage buffer used by the shader: - reflection information for each storage buffer binding used by the shader:
- the shader stage the storage buffer appears in (SG_SHADERSTAGE_*) - the shader stage the storage buffer appears in (SG_SHADERSTAGE_*)
- whether the storage buffer is readonly (currently this must - whether the storage buffer is readonly
always be true)
- backend specific bindslots: - backend specific bindslots:
- HLSL: - HLSL:
- for readonly storage buffer bindings: `register(t0..23)` - for readonly storage buffer bindings: `register(t0..23)`
- for read/write storage buffer bindings: `register(u0..7)` - for read/write storage buffer bindings: `register(u0..11)`
- MSL: the buffer attribute `[[buffer(8..15)]]` - MSL: the buffer attribute `[[buffer(8..15)]]`
- WGSL: the binding in `@group(1) @binding(0..127)` - WGSL: the binding in `@group(1) @binding(0..127)`
- GL: the binding in `layout(binding=0..7)` - GL: the binding in `layout(binding=0..7)`
- reflection information for each storage image binding used by the shader:
- the shader stage (*must* be SG_SHADERSTAGE_COMPUTE)
- whether the storage image is writeonly or readwrite (for readonly
access use a regular texture binding instead)
- the image type expected by the shader (SG_IMAGETYPE_*)
- the access pixel format expected by the shader (SG_PIXELFORMAT_*),
note that only a subset of pixel formats is allowed for storage image
bindings
- backend specific bindslots:
- HLSL: the UAV register `register(u0..u11)`
- MSL: the texture attribute `[[texture(0..19)]]`
- WGSL: the binding in `@group(2) @binding(0..3)`
- GLSL: the binding in `layout(binding=0..3, [access_format])`
- reflection information for each combined image-sampler object - reflection information for each combined image-sampler object
used by the shader: used by the shader:
- the shader stage (SG_SHADERSTAGE_*) - the shader stage (SG_SHADERSTAGE_*)
@@ -3474,9 +3599,9 @@ Sampler_Desc :: struct {
For all GL backends, shader source-code must be provided. For D3D11 and Metal, For all GL backends, shader source-code must be provided. For D3D11 and Metal,
either shader source-code or byte-code can be provided. either shader source-code or byte-code can be provided.
NOTE that the uniform block, image, sampler and storage_buffer arrays NOTE that the uniform block, image, sampler, storage_buffer and
can have gaps. This allows to use the same sg_bindings struct for storage_image arrays may have gaps. This allows to use the same sg_bindings
different related shader variants. struct for different related shader variants.
For D3D11, if source code is provided, the d3dcompiler_47.dll will be loaded For D3D11, if source code is provided, the d3dcompiler_47.dll will be loaded
on demand. If this fails, shader creation will fail. When compiling HLSL on demand. If this fails, shader creation will fail. When compiling HLSL
@@ -3556,6 +3681,17 @@ Shader_Storage_Buffer :: struct {
glsl_binding_n : u8, glsl_binding_n : u8,
} }
Shader_Storage_Image :: struct {
stage : Shader_Stage,
image_type : Image_Type,
access_format : Pixel_Format,
writeonly : bool,
hlsl_register_u_n : u8,
msl_texture_n : u8,
wgsl_group2_binding_n : u8,
glsl_binding_n : u8,
}
Shader_Image_Sampler_Pair :: struct { Shader_Image_Sampler_Pair :: struct {
stage : Shader_Stage, stage : Shader_Stage,
image_slot : u8, image_slot : u8,
@@ -3580,6 +3716,7 @@ Shader_Desc :: struct {
images : [16]Shader_Image, images : [16]Shader_Image,
samplers : [16]Shader_Sampler, samplers : [16]Shader_Sampler,
image_sampler_pairs : [16]Shader_Image_Sampler_Pair, image_sampler_pairs : [16]Shader_Image_Sampler_Pair,
storage_images : [4]Shader_Storage_Image,
mtl_threads_per_threadgroup : Mtl_Shader_Threads_Per_Threadgroup, mtl_threads_per_threadgroup : Mtl_Shader_Threads_Per_Threadgroup,
label : cstring, label : cstring,
_ : u32, _ : u32,
@@ -3613,6 +3750,10 @@ Shader_Desc :: struct {
Please note that ALL vertex attribute offsets must be 0 in order for the Please note that ALL vertex attribute offsets must be 0 in order for the
automatic offset computation to kick in. automatic offset computation to kick in.
Note that if you use vertex-pulling from storage buffers instead of
fixed-function vertex input you can simply omit the entire nested .layout
struct.
The default configuration is as follows: The default configuration is as follows:
.compute: false (must be set to true for a compute pipeline) .compute: false (must be set to true for a compute pipeline)
@@ -3748,11 +3889,25 @@ Pipeline_Desc :: struct {
Creation parameters for an sg_attachments object, used as argument to the Creation parameters for an sg_attachments object, used as argument to the
sg_make_attachments() function. sg_make_attachments() function.
An attachments object bundles 0..4 color attachments, 0..4 msaa-resolve An attachments object bundles either bundles 'render attachments' for
attachments, and none or one depth-stencil attachmente for use a render pass, or 'storage attachments' for a compute pass which writes
in a render pass. At least one color attachment or one depth-stencil to storage images.
attachment must be provided (no color attachment and a depth-stencil
attachment is useful for a depth-only render pass). Render attachments are:
- 0..4 color attachment images
- 0..4 msaa-resolve attachment images
- 0 or one depth-stencil attachment image
Note that all types of render attachment images must be created with
`sg_image_desc.usage.render_attachment = true`. At least one color-attachment
or depth-stencil-attachment image must be provided in a render pass
(only providing a depth-stencil-attachment is useful for depth-only passes).
Alternatively provide 1..4 storage attachment images which must be created
with `sg_image_desc.usage.storage_attachment = true`.
An sg_attachments object cannot have both render- and storage-attachments.
Each attachment definition consists of an image object, and two additional indices Each attachment definition consists of an image object, and two additional indices
describing which subimage the pass will render into: one mipmap index, and if the image describing which subimage the pass will render into: one mipmap index, and if the image
@@ -3784,6 +3939,7 @@ Attachments_Desc :: struct {
colors : [4]Attachment_Desc, colors : [4]Attachment_Desc,
resolves : [4]Attachment_Desc, resolves : [4]Attachment_Desc,
depth_stencil : Attachment_Desc, depth_stencil : Attachment_Desc,
storages : [4]Attachment_Desc,
label : cstring, label : cstring,
_ : u32, _ : u32,
} }
@@ -4022,6 +4178,7 @@ Log_Item :: enum i32 {
GL_3D_TEXTURES_NOT_SUPPORTED, GL_3D_TEXTURES_NOT_SUPPORTED,
GL_ARRAY_TEXTURES_NOT_SUPPORTED, GL_ARRAY_TEXTURES_NOT_SUPPORTED,
GL_STORAGEBUFFER_GLSL_BINDING_OUT_OF_RANGE, GL_STORAGEBUFFER_GLSL_BINDING_OUT_OF_RANGE,
GL_STORAGEIMAGE_GLSL_BINDING_OUT_OF_RANGE,
GL_SHADER_COMPILATION_FAILED, GL_SHADER_COMPILATION_FAILED,
GL_SHADER_LINKING_FAILED, GL_SHADER_LINKING_FAILED,
GL_VERTEX_ATTRIBUTE_NOT_FOUND_IN_SHADER, GL_VERTEX_ATTRIBUTE_NOT_FOUND_IN_SHADER,
@@ -4051,6 +4208,7 @@ Log_Item :: enum i32 {
D3D11_STORAGEBUFFER_HLSL_REGISTER_U_OUT_OF_RANGE, D3D11_STORAGEBUFFER_HLSL_REGISTER_U_OUT_OF_RANGE,
D3D11_IMAGE_HLSL_REGISTER_T_OUT_OF_RANGE, D3D11_IMAGE_HLSL_REGISTER_T_OUT_OF_RANGE,
D3D11_SAMPLER_HLSL_REGISTER_S_OUT_OF_RANGE, D3D11_SAMPLER_HLSL_REGISTER_S_OUT_OF_RANGE,
D3D11_STORAGEIMAGE_HLSL_REGISTER_U_OUT_OF_RANGE,
D3D11_LOAD_D3DCOMPILER_47_DLL_FAILED, D3D11_LOAD_D3DCOMPILER_47_DLL_FAILED,
D3D11_SHADER_COMPILATION_FAILED, D3D11_SHADER_COMPILATION_FAILED,
D3D11_SHADER_COMPILATION_OUTPUT, D3D11_SHADER_COMPILATION_OUTPUT,
@@ -4061,6 +4219,7 @@ Log_Item :: enum i32 {
D3D11_CREATE_BLEND_STATE_FAILED, D3D11_CREATE_BLEND_STATE_FAILED,
D3D11_CREATE_RTV_FAILED, D3D11_CREATE_RTV_FAILED,
D3D11_CREATE_DSV_FAILED, D3D11_CREATE_DSV_FAILED,
D3D11_CREATE_UAV_FAILED,
D3D11_MAP_FOR_UPDATE_BUFFER_FAILED, D3D11_MAP_FOR_UPDATE_BUFFER_FAILED,
D3D11_MAP_FOR_APPEND_BUFFER_FAILED, D3D11_MAP_FOR_APPEND_BUFFER_FAILED,
D3D11_MAP_FOR_UPDATE_IMAGE_FAILED, D3D11_MAP_FOR_UPDATE_IMAGE_FAILED,
@@ -4074,6 +4233,7 @@ Log_Item :: enum i32 {
METAL_SHADER_ENTRY_NOT_FOUND, METAL_SHADER_ENTRY_NOT_FOUND,
METAL_UNIFORMBLOCK_MSL_BUFFER_SLOT_OUT_OF_RANGE, METAL_UNIFORMBLOCK_MSL_BUFFER_SLOT_OUT_OF_RANGE,
METAL_STORAGEBUFFER_MSL_BUFFER_SLOT_OUT_OF_RANGE, METAL_STORAGEBUFFER_MSL_BUFFER_SLOT_OUT_OF_RANGE,
METAL_STORAGEIMAGE_MSL_TEXTURE_SLOT_OUT_OF_RANGE,
METAL_IMAGE_MSL_TEXTURE_SLOT_OUT_OF_RANGE, METAL_IMAGE_MSL_TEXTURE_SLOT_OUT_OF_RANGE,
METAL_SAMPLER_MSL_SAMPLER_SLOT_OUT_OF_RANGE, METAL_SAMPLER_MSL_SAMPLER_SLOT_OUT_OF_RANGE,
METAL_CREATE_CPS_FAILED, METAL_CREATE_CPS_FAILED,
@@ -4095,6 +4255,7 @@ Log_Item :: enum i32 {
WGPU_STORAGEBUFFER_WGSL_GROUP1_BINDING_OUT_OF_RANGE, WGPU_STORAGEBUFFER_WGSL_GROUP1_BINDING_OUT_OF_RANGE,
WGPU_IMAGE_WGSL_GROUP1_BINDING_OUT_OF_RANGE, WGPU_IMAGE_WGSL_GROUP1_BINDING_OUT_OF_RANGE,
WGPU_SAMPLER_WGSL_GROUP1_BINDING_OUT_OF_RANGE, WGPU_SAMPLER_WGSL_GROUP1_BINDING_OUT_OF_RANGE,
WGPU_STORAGEIMAGE_WGSL_GROUP2_BINDING_OUT_OF_RANGE,
WGPU_CREATE_PIPELINE_LAYOUT_FAILED, WGPU_CREATE_PIPELINE_LAYOUT_FAILED,
WGPU_CREATE_RENDER_PIPELINE_FAILED, WGPU_CREATE_RENDER_PIPELINE_FAILED,
WGPU_CREATE_COMPUTE_PIPELINE_FAILED, WGPU_CREATE_COMPUTE_PIPELINE_FAILED,
@@ -4136,27 +4297,35 @@ Log_Item :: enum i32 {
APPLY_BINDINGS_STORAGE_BUFFER_TRACKER_EXHAUSTED, APPLY_BINDINGS_STORAGE_BUFFER_TRACKER_EXHAUSTED,
DRAW_WITHOUT_BINDINGS, DRAW_WITHOUT_BINDINGS,
VALIDATE_BUFFERDESC_CANARY, VALIDATE_BUFFERDESC_CANARY,
VALIDATE_BUFFERDESC_IMMUTABLE_DYNAMIC_STREAM,
VALIDATE_BUFFERDESC_SEPARATE_BUFFER_TYPES,
VALIDATE_BUFFERDESC_EXPECT_NONZERO_SIZE, VALIDATE_BUFFERDESC_EXPECT_NONZERO_SIZE,
VALIDATE_BUFFERDESC_EXPECT_MATCHING_DATA_SIZE, VALIDATE_BUFFERDESC_EXPECT_MATCHING_DATA_SIZE,
VALIDATE_BUFFERDESC_EXPECT_ZERO_DATA_SIZE, VALIDATE_BUFFERDESC_EXPECT_ZERO_DATA_SIZE,
VALIDATE_BUFFERDESC_EXPECT_NO_DATA, VALIDATE_BUFFERDESC_EXPECT_NO_DATA,
VALIDATE_BUFFERDESC_EXPECT_DATA,
VALIDATE_BUFFERDESC_STORAGEBUFFER_SUPPORTED, VALIDATE_BUFFERDESC_STORAGEBUFFER_SUPPORTED,
VALIDATE_BUFFERDESC_STORAGEBUFFER_SIZE_MULTIPLE_4, VALIDATE_BUFFERDESC_STORAGEBUFFER_SIZE_MULTIPLE_4,
VALIDATE_IMAGEDATA_NODATA, VALIDATE_IMAGEDATA_NODATA,
VALIDATE_IMAGEDATA_DATA_SIZE, VALIDATE_IMAGEDATA_DATA_SIZE,
VALIDATE_IMAGEDESC_CANARY, VALIDATE_IMAGEDESC_CANARY,
VALIDATE_IMAGEDESC_IMMUTABLE_DYNAMIC_STREAM,
VALIDATE_IMAGEDESC_RENDER_VS_STORAGE_ATTACHMENT,
VALIDATE_IMAGEDESC_WIDTH, VALIDATE_IMAGEDESC_WIDTH,
VALIDATE_IMAGEDESC_HEIGHT, VALIDATE_IMAGEDESC_HEIGHT,
VALIDATE_IMAGEDESC_RT_PIXELFORMAT,
VALIDATE_IMAGEDESC_NONRT_PIXELFORMAT, VALIDATE_IMAGEDESC_NONRT_PIXELFORMAT,
VALIDATE_IMAGEDESC_MSAA_BUT_NO_RT, VALIDATE_IMAGEDESC_MSAA_BUT_NO_ATTACHMENT,
VALIDATE_IMAGEDESC_NO_MSAA_RT_SUPPORT,
VALIDATE_IMAGEDESC_MSAA_NUM_MIPMAPS,
VALIDATE_IMAGEDESC_MSAA_3D_IMAGE,
VALIDATE_IMAGEDESC_MSAA_CUBE_IMAGE,
VALIDATE_IMAGEDESC_DEPTH_3D_IMAGE, VALIDATE_IMAGEDESC_DEPTH_3D_IMAGE,
VALIDATE_IMAGEDESC_RT_IMMUTABLE, VALIDATE_IMAGEDESC_ATTACHMENT_EXPECT_IMMUTABLE,
VALIDATE_IMAGEDESC_RT_NO_DATA, VALIDATE_IMAGEDESC_ATTACHMENT_EXPECT_NO_DATA,
VALIDATE_IMAGEDESC_RENDERATTACHMENT_NO_MSAA_SUPPORT,
VALIDATE_IMAGEDESC_RENDERATTACHMENT_MSAA_NUM_MIPMAPS,
VALIDATE_IMAGEDESC_RENDERATTACHMENT_MSAA_3D_IMAGE,
VALIDATE_IMAGEDESC_RENDERATTACHMENT_MSAA_CUBE_IMAGE,
VALIDATE_IMAGEDESC_RENDERATTACHMENT_MSAA_ARRAY_IMAGE,
VALIDATE_IMAGEDESC_RENDERATTACHMENT_PIXELFORMAT,
VALIDATE_IMAGEDESC_STORAGEATTACHMENT_PIXELFORMAT,
VALIDATE_IMAGEDESC_STORAGEATTACHMENT_EXPECT_NO_MSAA,
VALIDATE_IMAGEDESC_INJECTED_NO_DATA, VALIDATE_IMAGEDESC_INJECTED_NO_DATA,
VALIDATE_IMAGEDESC_DYNAMIC_NO_DATA, VALIDATE_IMAGEDESC_DYNAMIC_NO_DATA,
VALIDATE_IMAGEDESC_COMPRESSED_IMMUTABLE, VALIDATE_IMAGEDESC_COMPRESSED_IMMUTABLE,
@@ -4195,6 +4364,15 @@ Log_Item :: enum i32 {
VALIDATE_SHADERDESC_STORAGEBUFFER_GLSL_BINDING_COLLISION, VALIDATE_SHADERDESC_STORAGEBUFFER_GLSL_BINDING_COLLISION,
VALIDATE_SHADERDESC_STORAGEBUFFER_WGSL_GROUP1_BINDING_OUT_OF_RANGE, VALIDATE_SHADERDESC_STORAGEBUFFER_WGSL_GROUP1_BINDING_OUT_OF_RANGE,
VALIDATE_SHADERDESC_STORAGEBUFFER_WGSL_GROUP1_BINDING_COLLISION, VALIDATE_SHADERDESC_STORAGEBUFFER_WGSL_GROUP1_BINDING_COLLISION,
VALIDATE_SHADERDESC_STORAGEIMAGE_EXPECT_COMPUTE_STAGE,
VALIDATE_SHADERDESC_STORAGEIMAGE_METAL_TEXTURE_SLOT_OUT_OF_RANGE,
VALIDATE_SHADERDESC_STORAGEIMAGE_METAL_TEXTURE_SLOT_COLLISION,
VALIDATE_SHADERDESC_STORAGEIMAGE_HLSL_REGISTER_U_OUT_OF_RANGE,
VALIDATE_SHADERDESC_STORAGEIMAGE_HLSL_REGISTER_U_COLLISION,
VALIDATE_SHADERDESC_STORAGEIMAGE_GLSL_BINDING_OUT_OF_RANGE,
VALIDATE_SHADERDESC_STORAGEIMAGE_GLSL_BINDING_COLLISION,
VALIDATE_SHADERDESC_STORAGEIMAGE_WGSL_GROUP2_BINDING_OUT_OF_RANGE,
VALIDATE_SHADERDESC_STORAGEIMAGE_WGSL_GROUP2_BINDING_COLLISION,
VALIDATE_SHADERDESC_IMAGE_METAL_TEXTURE_SLOT_OUT_OF_RANGE, VALIDATE_SHADERDESC_IMAGE_METAL_TEXTURE_SLOT_OUT_OF_RANGE,
VALIDATE_SHADERDESC_IMAGE_METAL_TEXTURE_SLOT_COLLISION, VALIDATE_SHADERDESC_IMAGE_METAL_TEXTURE_SLOT_COLLISION,
VALIDATE_SHADERDESC_IMAGE_HLSL_REGISTER_T_OUT_OF_RANGE, VALIDATE_SHADERDESC_IMAGE_HLSL_REGISTER_T_OUT_OF_RANGE,
@@ -4230,14 +4408,13 @@ Log_Item :: enum i32 {
VALIDATE_ATTACHMENTSDESC_CANARY, VALIDATE_ATTACHMENTSDESC_CANARY,
VALIDATE_ATTACHMENTSDESC_NO_ATTACHMENTS, VALIDATE_ATTACHMENTSDESC_NO_ATTACHMENTS,
VALIDATE_ATTACHMENTSDESC_NO_CONT_COLOR_ATTS, VALIDATE_ATTACHMENTSDESC_NO_CONT_COLOR_ATTS,
VALIDATE_ATTACHMENTSDESC_IMAGE, VALIDATE_ATTACHMENTSDESC_COLOR_IMAGE,
VALIDATE_ATTACHMENTSDESC_MIPLEVEL, VALIDATE_ATTACHMENTSDESC_COLOR_MIPLEVEL,
VALIDATE_ATTACHMENTSDESC_FACE, VALIDATE_ATTACHMENTSDESC_COLOR_FACE,
VALIDATE_ATTACHMENTSDESC_LAYER, VALIDATE_ATTACHMENTSDESC_COLOR_LAYER,
VALIDATE_ATTACHMENTSDESC_SLICE, VALIDATE_ATTACHMENTSDESC_COLOR_SLICE,
VALIDATE_ATTACHMENTSDESC_IMAGE_NO_RT, VALIDATE_ATTACHMENTSDESC_COLOR_IMAGE_NO_RENDERATTACHMENT,
VALIDATE_ATTACHMENTSDESC_COLOR_INV_PIXELFORMAT, VALIDATE_ATTACHMENTSDESC_COLOR_INV_PIXELFORMAT,
VALIDATE_ATTACHMENTSDESC_DEPTH_INV_PIXELFORMAT,
VALIDATE_ATTACHMENTSDESC_IMAGE_SIZES, VALIDATE_ATTACHMENTSDESC_IMAGE_SIZES,
VALIDATE_ATTACHMENTSDESC_IMAGE_SAMPLE_COUNTS, VALIDATE_ATTACHMENTSDESC_IMAGE_SAMPLE_COUNTS,
VALIDATE_ATTACHMENTSDESC_RESOLVE_COLOR_IMAGE_MSAA, VALIDATE_ATTACHMENTSDESC_RESOLVE_COLOR_IMAGE_MSAA,
@@ -4250,21 +4427,32 @@ Log_Item :: enum i32 {
VALIDATE_ATTACHMENTSDESC_RESOLVE_IMAGE_NO_RT, VALIDATE_ATTACHMENTSDESC_RESOLVE_IMAGE_NO_RT,
VALIDATE_ATTACHMENTSDESC_RESOLVE_IMAGE_SIZES, VALIDATE_ATTACHMENTSDESC_RESOLVE_IMAGE_SIZES,
VALIDATE_ATTACHMENTSDESC_RESOLVE_IMAGE_FORMAT, VALIDATE_ATTACHMENTSDESC_RESOLVE_IMAGE_FORMAT,
VALIDATE_ATTACHMENTSDESC_DEPTH_INV_PIXELFORMAT,
VALIDATE_ATTACHMENTSDESC_DEPTH_IMAGE, VALIDATE_ATTACHMENTSDESC_DEPTH_IMAGE,
VALIDATE_ATTACHMENTSDESC_DEPTH_MIPLEVEL, VALIDATE_ATTACHMENTSDESC_DEPTH_MIPLEVEL,
VALIDATE_ATTACHMENTSDESC_DEPTH_FACE, VALIDATE_ATTACHMENTSDESC_DEPTH_FACE,
VALIDATE_ATTACHMENTSDESC_DEPTH_LAYER, VALIDATE_ATTACHMENTSDESC_DEPTH_LAYER,
VALIDATE_ATTACHMENTSDESC_DEPTH_SLICE, VALIDATE_ATTACHMENTSDESC_DEPTH_SLICE,
VALIDATE_ATTACHMENTSDESC_DEPTH_IMAGE_NO_RT, VALIDATE_ATTACHMENTSDESC_DEPTH_IMAGE_NO_RENDERATTACHMENT,
VALIDATE_ATTACHMENTSDESC_DEPTH_IMAGE_SIZES, VALIDATE_ATTACHMENTSDESC_DEPTH_IMAGE_SIZES,
VALIDATE_ATTACHMENTSDESC_DEPTH_IMAGE_SAMPLE_COUNT, VALIDATE_ATTACHMENTSDESC_DEPTH_IMAGE_SAMPLE_COUNT,
VALIDATE_ATTACHMENTSDESC_STORAGE_IMAGE,
VALIDATE_ATTACHMENTSDESC_STORAGE_MIPLEVEL,
VALIDATE_ATTACHMENTSDESC_STORAGE_FACE,
VALIDATE_ATTACHMENTSDESC_STORAGE_LAYER,
VALIDATE_ATTACHMENTSDESC_STORAGE_SLICE,
VALIDATE_ATTACHMENTSDESC_STORAGE_IMAGE_NO_STORAGEATTACHMENT,
VALIDATE_ATTACHMENTSDESC_STORAGE_INV_PIXELFORMAT,
VALIDATE_ATTACHMENTSDESC_RENDER_VS_STORAGE_ATTACHMENTS,
VALIDATE_BEGINPASS_CANARY, VALIDATE_BEGINPASS_CANARY,
VALIDATE_BEGINPASS_EXPECT_NO_ATTACHMENTS,
VALIDATE_BEGINPASS_ATTACHMENTS_EXISTS, VALIDATE_BEGINPASS_ATTACHMENTS_EXISTS,
VALIDATE_BEGINPASS_ATTACHMENTS_VALID, VALIDATE_BEGINPASS_ATTACHMENTS_VALID,
VALIDATE_BEGINPASS_COMPUTEPASS_STORAGE_ATTACHMENTS_ONLY,
VALIDATE_BEGINPASS_RENDERPASS_RENDER_ATTACHMENTS_ONLY,
VALIDATE_BEGINPASS_COLOR_ATTACHMENT_IMAGE, VALIDATE_BEGINPASS_COLOR_ATTACHMENT_IMAGE,
VALIDATE_BEGINPASS_RESOLVE_ATTACHMENT_IMAGE, VALIDATE_BEGINPASS_RESOLVE_ATTACHMENT_IMAGE,
VALIDATE_BEGINPASS_DEPTHSTENCIL_ATTACHMENT_IMAGE, VALIDATE_BEGINPASS_DEPTHSTENCIL_ATTACHMENT_IMAGE,
VALIDATE_BEGINPASS_STORAGE_ATTACHMENT_IMAGE,
VALIDATE_BEGINPASS_SWAPCHAIN_EXPECT_WIDTH, VALIDATE_BEGINPASS_SWAPCHAIN_EXPECT_WIDTH,
VALIDATE_BEGINPASS_SWAPCHAIN_EXPECT_WIDTH_NOTSET, VALIDATE_BEGINPASS_SWAPCHAIN_EXPECT_WIDTH_NOTSET,
VALIDATE_BEGINPASS_SWAPCHAIN_EXPECT_HEIGHT, VALIDATE_BEGINPASS_SWAPCHAIN_EXPECT_HEIGHT,
@@ -4309,6 +4497,11 @@ Log_Item :: enum i32 {
VALIDATE_APIP_COLOR_FORMAT, VALIDATE_APIP_COLOR_FORMAT,
VALIDATE_APIP_DEPTH_FORMAT, VALIDATE_APIP_DEPTH_FORMAT,
VALIDATE_APIP_SAMPLE_COUNT, VALIDATE_APIP_SAMPLE_COUNT,
VALIDATE_APIP_EXPECTED_STORAGE_ATTACHMENT_IMAGE,
VALIDATE_APIP_STORAGE_ATTACHMENT_IMAGE_EXISTS,
VALIDATE_APIP_STORAGE_ATTACHMENT_IMAGE_VALID,
VALIDATE_APIP_STORAGE_ATTACHMENT_PIXELFORMAT,
VALIDATE_APIP_STORAGE_ATTACHMENT_IMAGE_TYPE,
VALIDATE_ABND_PASS_EXPECTED, VALIDATE_ABND_PASS_EXPECTED,
VALIDATE_ABND_EMPTY_BINDINGS, VALIDATE_ABND_EMPTY_BINDINGS,
VALIDATE_ABND_PIPELINE, VALIDATE_ABND_PIPELINE,
@@ -4341,6 +4534,10 @@ Log_Item :: enum i32 {
VALIDATE_ABND_STORAGEBUFFER_EXISTS, VALIDATE_ABND_STORAGEBUFFER_EXISTS,
VALIDATE_ABND_STORAGEBUFFER_BINDING_BUFFERTYPE, VALIDATE_ABND_STORAGEBUFFER_BINDING_BUFFERTYPE,
VALIDATE_ABND_STORAGEBUFFER_READWRITE_IMMUTABLE, VALIDATE_ABND_STORAGEBUFFER_READWRITE_IMMUTABLE,
VALIDATE_ABND_IMAGE_BINDING_VS_DEPTHSTENCIL_ATTACHMENT,
VALIDATE_ABND_IMAGE_BINDING_VS_COLOR_ATTACHMENT,
VALIDATE_ABND_IMAGE_BINDING_VS_RESOLVE_ATTACHMENT,
VALIDATE_ABND_IMAGE_BINDING_VS_STORAGE_ATTACHMENT,
VALIDATE_AU_PASS_EXPECTED, VALIDATE_AU_PASS_EXPECTED,
VALIDATE_AU_NO_PIPELINE, VALIDATE_AU_NO_PIPELINE,
VALIDATE_AU_NO_UNIFORMBLOCK_AT_SLOT, VALIDATE_AU_NO_UNIFORMBLOCK_AT_SLOT,