diff options
author | Mike Erwin <significant.bit@gmail.com> | 2017-05-22 00:53:16 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2017-05-22 00:53:16 +0300 |
commit | ea31c55b08e0add843f56af0a62d030fd25606f2 (patch) | |
tree | 9cfb7f43627c0152b75d04ae9a155e967dcb8fa1 /intern | |
parent | 3f6f02e4336455bd70df7b604bea57ce75d1d87c (diff) |
Gawain: cleanup code formatting
Diffstat (limited to 'intern')
-rw-r--r-- | intern/gawain/src/imm_util.c | 12 | ||||
-rw-r--r-- | intern/gawain/src/immediate.c | 18 |
2 files changed, 14 insertions, 16 deletions
diff --git a/intern/gawain/src/imm_util.c b/intern/gawain/src/imm_util.c index 74caeb6fd3a..de50ca96907 100644 --- a/intern/gawain/src/imm_util.c +++ b/intern/gawain/src/imm_util.c @@ -14,33 +14,33 @@ void immRectf(unsigned pos, float x1, float y1, float x2, float y2) -{ + { immBegin(PRIM_TRIANGLE_FAN, 4); immVertex2f(pos, x1, y1); immVertex2f(pos, x2, y1); immVertex2f(pos, x2, y2); immVertex2f(pos, x1, y2); immEnd(); -} + } void immRecti(unsigned pos, int x1, int y1, int x2, int y2) -{ + { immBegin(PRIM_TRIANGLE_FAN, 4); immVertex2i(pos, x1, y1); immVertex2i(pos, x2, y1); immVertex2i(pos, x2, y2); immVertex2i(pos, x1, y2); immEnd(); -} + } #if 0 // more complete version in case we want that void immRecti_complete(int x1, int y1, int x2, int y2, const float color[4]) -{ + { VertexFormat *format = immVertexFormat(); unsigned pos = add_attrib(format, "pos", COMP_I32, 2, CONVERT_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor4fv(color); immRecti(pos, x1, y1, x2, y2); immUnbindProgram(); -} + } #endif diff --git a/intern/gawain/src/immediate.c b/intern/gawain/src/immediate.c index 7c3b0e11e92..8b6f0fdbff5 100644 --- a/intern/gawain/src/immediate.c +++ b/intern/gawain/src/immediate.c @@ -749,12 +749,10 @@ void immVertex2iv(unsigned attrib_id, const int data[2]) #define GET_UNIFORM const ShaderInput* uniform = ShaderInterface_uniform(imm.shader_interface, name); #endif #else -/* NOTE: It is possible to have uniform fully optimized out from the shader. - * In this case we can't assert failure or allow NULL-pointer dereference. - * - * TODO(sergey): How can we detect existing-but-optimized-out uniform but still - * catch typos in uniform names passed to immUniform*() functions? - */ + // NOTE: It is possible to have uniform fully optimized out from the shader. + // In this case we can't assert failure or allow NULL-pointer dereference. + // TODO(sergey): How can we detect existing-but-optimized-out uniform but still + // catch typos in uniform names passed to immUniform*() functions? #define GET_UNIFORM const ShaderInput* uniform = ShaderInterface_uniform(imm.shader_interface, name); if (uniform == NULL) return; #endif @@ -765,16 +763,16 @@ void immUniform1f(const char* name, float x) } void immUniform2f(const char* name, float x, float y) -{ + { GET_UNIFORM glUniform2f(uniform->location, x, y); -} + } void immUniform2fv(const char* name, const float data[2]) -{ + { GET_UNIFORM glUniform2fv(uniform->location, 1, data); -} + } void immUniform3f(const char* name, float x, float y, float z) { |