Reformat
This commit is contained in:
parent
ab71bbc438
commit
fb1b8457d6
@ -20,8 +20,8 @@ ShaderID register_shader(void *shader, VertexShader *vertex,
|
|||||||
}
|
}
|
||||||
|
|
||||||
++(g_repository.count);
|
++(g_repository.count);
|
||||||
g_repository.shaders[g_repository.count] = shader;
|
g_repository.shaders[g_repository.count] = shader;
|
||||||
g_repository.vertex_funcs[g_repository.count] = vertex;
|
g_repository.vertex_funcs[g_repository.count] = vertex;
|
||||||
g_repository.fragment_funcs[g_repository.count] = fragment;
|
g_repository.fragment_funcs[g_repository.count] = fragment;
|
||||||
|
|
||||||
return (ShaderID){g_repository.count};
|
return (ShaderID){g_repository.count};
|
||||||
@ -29,12 +29,11 @@ ShaderID register_shader(void *shader, VertexShader *vertex,
|
|||||||
|
|
||||||
VertexData run_vertex_shader(ShaderID shader, const VertexData *vert, u8 index,
|
VertexData run_vertex_shader(ShaderID shader, const VertexData *vert, u8 index,
|
||||||
const Model *model) {
|
const Model *model) {
|
||||||
if (IS_INVALID_SHADER(shader) || shader.id > g_repository.count || !vert ||
|
if (IS_INVALID_SHADER(shader) || shader.id > g_repository.count || !vert || !model) {
|
||||||
!model) {
|
|
||||||
return (VertexData){0};
|
return (VertexData){0};
|
||||||
}
|
}
|
||||||
|
|
||||||
void *shader_obj = g_repository.shaders[shader.id];
|
void *shader_obj = g_repository.shaders[shader.id];
|
||||||
VertexShader *vertex_func = g_repository.vertex_funcs[shader.id];
|
VertexShader *vertex_func = g_repository.vertex_funcs[shader.id];
|
||||||
|
|
||||||
if (!shader_obj || !vertex_func) {
|
if (!shader_obj || !vertex_func) {
|
||||||
@ -50,7 +49,7 @@ FragmentResult run_fragment_shader(ShaderID shader, const V3f *barycentric,
|
|||||||
return DISCARDED_FRAGMENT;
|
return DISCARDED_FRAGMENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *shader_obj = g_repository.shaders[shader.id];
|
void *shader_obj = g_repository.shaders[shader.id];
|
||||||
FragmentShader *fragment_func = g_repository.fragment_funcs[shader.id];
|
FragmentShader *fragment_func = g_repository.fragment_funcs[shader.id];
|
||||||
|
|
||||||
if (!shader_obj || !fragment_func) {
|
if (!shader_obj || !fragment_func) {
|
||||||
|
Loading…
Reference in New Issue
Block a user