diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/gpu/intern/gpu_attr_binding.c | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/gpu/intern/gpu_attr_binding.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_attr_binding.c | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/source/blender/gpu/intern/gpu_attr_binding.c b/source/blender/gpu/intern/gpu_attr_binding.c index 242c157bec1..6cd350df505 100644 --- a/source/blender/gpu/intern/gpu_attr_binding.c +++ b/source/blender/gpu/intern/gpu_attr_binding.c @@ -34,46 +34,48 @@ void AttrBinding_clear(GPUAttrBinding *binding) { - binding->loc_bits = 0; - binding->enabled_bits = 0; + binding->loc_bits = 0; + binding->enabled_bits = 0; } uint read_attr_location(const GPUAttrBinding *binding, uint a_idx) { #if TRUST_NO_ONE - assert(a_idx < GPU_VERT_ATTR_MAX_LEN); - assert(binding->enabled_bits & (1 << a_idx)); + assert(a_idx < GPU_VERT_ATTR_MAX_LEN); + assert(binding->enabled_bits & (1 << a_idx)); #endif - return (binding->loc_bits >> (4 * a_idx)) & 0xF; + return (binding->loc_bits >> (4 * a_idx)) & 0xF; } static void write_attr_location(GPUAttrBinding *binding, uint a_idx, uint location) { #if TRUST_NO_ONE - assert(a_idx < GPU_VERT_ATTR_MAX_LEN); - assert(location < GPU_VERT_ATTR_MAX_LEN); + assert(a_idx < GPU_VERT_ATTR_MAX_LEN); + assert(location < GPU_VERT_ATTR_MAX_LEN); #endif - const uint shift = 4 * a_idx; - const uint64_t mask = ((uint64_t)0xF) << shift; - /* overwrite this attr's previous location */ - binding->loc_bits = (binding->loc_bits & ~mask) | (location << shift); - /* mark this attr as enabled */ - binding->enabled_bits |= 1 << a_idx; + const uint shift = 4 * a_idx; + const uint64_t mask = ((uint64_t)0xF) << shift; + /* overwrite this attr's previous location */ + binding->loc_bits = (binding->loc_bits & ~mask) | (location << shift); + /* mark this attr as enabled */ + binding->enabled_bits |= 1 << a_idx; } -void get_attr_locations(const GPUVertFormat *format, GPUAttrBinding *binding, const GPUShaderInterface *shaderface) +void get_attr_locations(const GPUVertFormat *format, + GPUAttrBinding *binding, + const GPUShaderInterface *shaderface) { - AttrBinding_clear(binding); + AttrBinding_clear(binding); - for (uint a_idx = 0; a_idx < format->attr_len; ++a_idx) { - const GPUVertAttr *a = &format->attrs[a_idx]; - for (uint n_idx = 0; n_idx < a->name_len; ++n_idx) { - const GPUShaderInput *input = GPU_shaderinterface_attr(shaderface, a->name[n_idx]); + for (uint a_idx = 0; a_idx < format->attr_len; ++a_idx) { + const GPUVertAttr *a = &format->attrs[a_idx]; + for (uint n_idx = 0; n_idx < a->name_len; ++n_idx) { + const GPUShaderInput *input = GPU_shaderinterface_attr(shaderface, a->name[n_idx]); #if TRUST_NO_ONE - assert(input != NULL); - /* TODO: make this a recoverable runtime error? indicates mismatch between vertex format and program */ + assert(input != NULL); + /* TODO: make this a recoverable runtime error? indicates mismatch between vertex format and program */ #endif - write_attr_location(binding, a_idx, input->location); - } - } + write_attr_location(binding, a_idx, input->location); + } + } } |