Skip to content

Commit

Permalink
sg_shader_bind_stage => sg_shader_stage
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed Sep 14, 2024
1 parent 1b93b86 commit cb6681c
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 45 deletions.
8 changes: 4 additions & 4 deletions metal/arraytex-metal.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,21 +164,21 @@ static void init(void) {
" return float4(c0.xyz + c1.xyz + c2.xyz, 1.0);\n"
"}\n",
.uniform_blocks[0] = {
.stage = SG_SHADERBINDSTAGE_VERTEX,
.stage = SG_SHADERSTAGE_VERTEX,
.size = sizeof(vs_params_t),
.msl_buffer_n = 0,
},
.images[0] = {
.stage = SG_SHADERBINDSTAGE_FRAGMENT,
.stage = SG_SHADERSTAGE_FRAGMENT,
.image_type = SG_IMAGETYPE_ARRAY,
.msl_texture_n = 0,
},
.samplers[0] = {
.stage = SG_SHADERBINDSTAGE_FRAGMENT,
.stage = SG_SHADERSTAGE_FRAGMENT,
.msl_sampler_n = 0,
},
.image_sampler_pairs[0] = {
.stage = SG_SHADERBINDSTAGE_FRAGMENT,
.stage = SG_SHADERSTAGE_FRAGMENT,
.image_slot = 0,
.sampler_slot = 0,
},
Expand Down
2 changes: 1 addition & 1 deletion metal/binshader-metal.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static void init(void) {
.vertex_func.bytecode = SG_RANGE(vs_bytecode),
.fragment_func.bytecode = SG_RANGE(fs_bytecode),
.uniform_blocks[0] = {
.stage = SG_SHADERBINDSTAGE_VERTEX,
.stage = SG_SHADERSTAGE_VERTEX,
.size = sizeof(vs_params_t),
.msl_buffer_n = 0,
},
Expand Down
4 changes: 2 additions & 2 deletions metal/blend-metal.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static void init(void) {
"}\n"
},
.uniform_blocks[0] = {
.stage = SG_SHADERBINDSTAGE_FRAGMENT,
.stage = SG_SHADERSTAGE_FRAGMENT,
.size = sizeof(fs_params_t),
.msl_buffer_n = 0,
},
Expand Down Expand Up @@ -152,7 +152,7 @@ static void init(void) {
"};\n"
},
.uniform_blocks[0] = {
.stage = SG_SHADERBINDSTAGE_VERTEX,
.stage = SG_SHADERSTAGE_VERTEX,
.size = sizeof(vs_params_t),
.msl_buffer_n = 0,
},
Expand Down
2 changes: 1 addition & 1 deletion metal/cube-metal.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static void init(void) {
// not their internal layout
sg_shader shd = sg_make_shader(&(sg_shader_desc){
.uniform_blocks[0] = {
.stage = SG_SHADERBINDSTAGE_VERTEX,
.stage = SG_SHADERSTAGE_VERTEX,
.size = sizeof(vs_params_t),
.msl_buffer_n = 0,
},
Expand Down
8 changes: 4 additions & 4 deletions metal/dyntex-metal.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,20 @@ static void init(void) {
" return float4(tex.sample(smp, in.uv).xyz, 1.0) * in.color;\n"
"};\n",
.uniform_blocks[0] = {
.stage = SG_SHADERBINDSTAGE_VERTEX,
.stage = SG_SHADERSTAGE_VERTEX,
.size = sizeof(vs_params_t),
.msl_buffer_n = 0,
},
.images[0] = {
.stage = SG_SHADERBINDSTAGE_FRAGMENT,
.stage = SG_SHADERSTAGE_FRAGMENT,
.msl_texture_n = 0,
},
.samplers[0] = {
.stage = SG_SHADERBINDSTAGE_FRAGMENT,
.stage = SG_SHADERSTAGE_FRAGMENT,
.msl_sampler_n = 0,
},
.image_sampler_pairs[0] = {
.stage = SG_SHADERBINDSTAGE_FRAGMENT,
.stage = SG_SHADERSTAGE_FRAGMENT,
.image_slot = 0,
.sampler_slot = 0,
},
Expand Down
8 changes: 4 additions & 4 deletions metal/inject-metal.m
Original file line number Diff line number Diff line change
Expand Up @@ -197,20 +197,20 @@ static void init(void) {
"};\n"
},
.uniform_blocks[0] = {
.stage = SG_SHADERBINDSTAGE_VERTEX,
.stage = SG_SHADERSTAGE_VERTEX,
.size = sizeof(vs_params_t),
.msl_buffer_n = 0,
},
.images[0] = {
.stage = SG_SHADERBINDSTAGE_FRAGMENT,
.stage = SG_SHADERSTAGE_FRAGMENT,
.msl_texture_n = 0,
},
.samplers[0] = {
.stage = SG_SHADERBINDSTAGE_FRAGMENT,
.stage = SG_SHADERSTAGE_FRAGMENT,
.msl_sampler_n = 0,
},
.image_sampler_pairs[0] = {
.stage = SG_SHADERBINDSTAGE_FRAGMENT,
.stage = SG_SHADERSTAGE_FRAGMENT,
.image_slot = 0,
.sampler_slot = 0,
},
Expand Down
2 changes: 1 addition & 1 deletion metal/instancing-metal.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static void init(void) {
" return color;\n"
"}\n",
.uniform_blocks[0] = {
.stage = SG_SHADERBINDSTAGE_VERTEX,
.stage = SG_SHADERSTAGE_VERTEX,
.size = sizeof(vs_params_t),
.msl_buffer_n = 0,
},
Expand Down
8 changes: 4 additions & 4 deletions metal/mipmap-metal.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,20 +181,20 @@ static void init(void) {
"};\n"
},
.uniform_blocks[0] = {
.stage = SG_SHADERBINDSTAGE_VERTEX,
.stage = SG_SHADERSTAGE_VERTEX,
.size = sizeof(vs_params_t),
.msl_buffer_n = 0,
},
.images[0] = {
.stage = SG_SHADERBINDSTAGE_FRAGMENT,
.stage = SG_SHADERSTAGE_FRAGMENT,
.msl_texture_n = 0,
},
.samplers[0] = {
.stage = SG_SHADERBINDSTAGE_FRAGMENT,
.stage = SG_SHADERSTAGE_FRAGMENT,
.msl_sampler_n = 0,
},
.image_sampler_pairs[0] = {
.stage = SG_SHADERBINDSTAGE_FRAGMENT,
.stage = SG_SHADERSTAGE_FRAGMENT,
.image_slot = 0,
.sampler_slot = 0,
},
Expand Down
24 changes: 12 additions & 12 deletions metal/mrt-metal.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ static void init(void) {
" return out;\n"
"}\n",
.uniform_blocks[0] = {
.stage = SG_SHADERBINDSTAGE_VERTEX,
.stage = SG_SHADERSTAGE_VERTEX,
.size = sizeof(offscreen_params_t),
.msl_buffer_n = 0,
},
Expand Down Expand Up @@ -270,22 +270,22 @@ static void init(void) {
" return float4(c0 + c1 + c2, 1.0);\n"
"}\n",
.uniform_blocks[0] = {
.stage = SG_SHADERBINDSTAGE_VERTEX,
.stage = SG_SHADERSTAGE_VERTEX,
.size = sizeof(params_t),
.msl_buffer_n = 0,
},
.images = {
[0] = { .stage = SG_SHADERBINDSTAGE_FRAGMENT, .msl_texture_n = 0 },
[1] = { .stage = SG_SHADERBINDSTAGE_FRAGMENT, .msl_texture_n = 1 },
[2] = { .stage = SG_SHADERBINDSTAGE_FRAGMENT, .msl_texture_n = 2 },
[0] = { .stage = SG_SHADERSTAGE_FRAGMENT, .msl_texture_n = 0 },
[1] = { .stage = SG_SHADERSTAGE_FRAGMENT, .msl_texture_n = 1 },
[2] = { .stage = SG_SHADERSTAGE_FRAGMENT, .msl_texture_n = 2 },
},
.samplers = {
[0] = { .stage = SG_SHADERBINDSTAGE_FRAGMENT, .msl_sampler_n = 0 },
[0] = { .stage = SG_SHADERSTAGE_FRAGMENT, .msl_sampler_n = 0 },
},
.image_sampler_pairs = {
[0] = { .stage = SG_SHADERBINDSTAGE_FRAGMENT, .image_slot = 0, .sampler_slot = 0 },
[1] = { .stage = SG_SHADERBINDSTAGE_FRAGMENT, .image_slot = 1, .sampler_slot = 0 },
[2] = { .stage = SG_SHADERBINDSTAGE_FRAGMENT, .image_slot = 2, .sampler_slot = 0 },
[0] = { .stage = SG_SHADERSTAGE_FRAGMENT, .image_slot = 0, .sampler_slot = 0 },
[1] = { .stage = SG_SHADERSTAGE_FRAGMENT, .image_slot = 1, .sampler_slot = 0 },
[2] = { .stage = SG_SHADERSTAGE_FRAGMENT, .image_slot = 2, .sampler_slot = 0 },
},
});

Expand Down Expand Up @@ -337,9 +337,9 @@ static void init(void) {
"fragment float4 _main(float2 uv [[stage_in]], texture2d<float> tex [[texture(0)]], sampler smp [[sampler(0)]]) {\n"
" return float4(tex.sample(smp, uv).xyz, 1.0);\n"
"}\n",
.images[0] = { .stage = SG_SHADERBINDSTAGE_FRAGMENT, .msl_texture_n = 0 },
.samplers[0] = { .stage = SG_SHADERBINDSTAGE_FRAGMENT, .msl_sampler_n = 0 },
.image_sampler_pairs[0] = { .stage = SG_SHADERBINDSTAGE_FRAGMENT, .image_slot = 0, .sampler_slot = 0 },
.images[0] = { .stage = SG_SHADERSTAGE_FRAGMENT, .msl_texture_n = 0 },
.samplers[0] = { .stage = SG_SHADERSTAGE_FRAGMENT, .msl_sampler_n = 0 },
.image_sampler_pairs[0] = { .stage = SG_SHADERSTAGE_FRAGMENT, .image_slot = 0, .sampler_slot = 0 },
}),
});
// images will be filled right before rendering
Expand Down
2 changes: 1 addition & 1 deletion metal/noninterleaved-metal.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ static void init(void) {
" return color;\n"
"}\n",
.uniform_blocks[0] = {
.stage = SG_SHADERBINDSTAGE_VERTEX,
.stage = SG_SHADERSTAGE_VERTEX,
.size = sizeof(vs_params_t),
.msl_buffer_n = 0,
},
Expand Down
10 changes: 5 additions & 5 deletions metal/offscreen-metal.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ static void init(void) {
" return color;\n"
"};\n",
.uniform_blocks[0] = {
.stage = SG_SHADERBINDSTAGE_VERTEX,
.stage = SG_SHADERSTAGE_VERTEX,
.size = sizeof(vs_params_t),
.msl_buffer_n = 0,
},
Expand Down Expand Up @@ -220,20 +220,20 @@ static void init(void) {
" return float4(tex.sample(smp, in.uv).xyz + in.color.xyz * 0.5, 1.0);\n"
"};\n",
.uniform_blocks[0] = {
.stage = SG_SHADERBINDSTAGE_VERTEX,
.stage = SG_SHADERSTAGE_VERTEX,
.size = sizeof(vs_params_t),
.msl_buffer_n = 0,
},
.images[0] = {
.stage = SG_SHADERBINDSTAGE_FRAGMENT,
.stage = SG_SHADERSTAGE_FRAGMENT,
.msl_texture_n = 0,
},
.samplers[0] = {
.stage = SG_SHADERBINDSTAGE_FRAGMENT,
.stage = SG_SHADERSTAGE_FRAGMENT,
.msl_sampler_n = 0,
},
.image_sampler_pairs[0] = {
.stage = SG_SHADERBINDSTAGE_FRAGMENT,
.stage = SG_SHADERSTAGE_FRAGMENT,
.image_slot = 0,
.sampler_slot = 0,
},
Expand Down
8 changes: 4 additions & 4 deletions metal/texcube-metal.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,20 +146,20 @@ static void init(void) {
"};\n"
},
.uniform_blocks[0] = {
.stage = SG_SHADERBINDSTAGE_VERTEX,
.stage = SG_SHADERSTAGE_VERTEX,
.size = sizeof(vs_params_t),
.msl_buffer_n = 0,
},
.images[0] = {
.stage = SG_SHADERBINDSTAGE_FRAGMENT,
.stage = SG_SHADERSTAGE_FRAGMENT,
.msl_texture_n = 0
},
.samplers[0] = {
.stage = SG_SHADERBINDSTAGE_FRAGMENT,
.stage = SG_SHADERSTAGE_FRAGMENT,
.msl_sampler_n = 0
},
.image_sampler_pairs[0] = {
.stage = SG_SHADERBINDSTAGE_FRAGMENT,
.stage = SG_SHADERSTAGE_FRAGMENT,
.image_slot = 0,
.sampler_slot = 0
},
Expand Down
4 changes: 2 additions & 2 deletions metal/vertexpulling-metal.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ static void init(void) {
" return color;\n"
"}\n",
.uniform_blocks[0] = {
.stage = SG_SHADERBINDSTAGE_VERTEX,
.stage = SG_SHADERSTAGE_VERTEX,
.size = sizeof(vs_params_t),
.msl_buffer_n = 0,
},
.storage_buffers[0] = {
.stage = SG_SHADERBINDSTAGE_VERTEX,
.stage = SG_SHADERSTAGE_VERTEX,
.readonly = true,
.msl_buffer_n = 1,
},
Expand Down

0 comments on commit cb6681c

Please sign in to comment.