Created
April 24, 2019 09:51
-
-
Save floooh/09cd534b175430cd0a8dff6d1b8637ad to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sg_shader shd = sg_make_shader(&(sg_shader_desc){ | |
.attrs = { | |
[0] = { .sem_name="POS", .sem_index=0 }, | |
[1] = { .sem_name="COLOR", .sem_index=0 } | |
}, | |
.vs.source = ... | |
"struct vs_in {\n" | |
" float4 pos: POS;\n" | |
" float4 color: COLOR;\n" | |
"};\n" | |
... | |
.fs.source = .. | |
}); | |
sg_pipeline pip = sg_make_pipeline(&(sg_pipeline_desc){ | |
.layout = { | |
.attrs = { | |
/* semantic name and index looked up from attrs table in shader */ | |
[0] = { .format = SG_VERTEXFORMAT_FLOAT3 }, | |
[1] = { .format = SG_VERTEXFORMAT_FLOAT4 } | |
} | |
}, | |
.shader = shd | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment