diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-10-09 03:01:50 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-10-09 03:01:50 +0300 |
commit | e7218e7049972053140d94410aea75e0c3e87c61 (patch) | |
tree | 6c73c7d89ccf52cdbce88ec83f0b2052a1038f45 /source/blender/gpu | |
parent | 9b49a0d971c50d3316b8b752e6a9f35f67fd53c8 (diff) |
Cleanup: naming
- immAttrib* -> immAttr*
- immSkipAttrib -> immAttrSkip
Term 'attr' is a convention for GPU module.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/GPU_immediate.h | 30 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_immediate.c | 56 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_immediate_util.c | 30 |
3 files changed, 58 insertions, 58 deletions
diff --git a/source/blender/gpu/GPU_immediate.h b/source/blender/gpu/GPU_immediate.h index 516f9e60d12..846adc44cee 100644 --- a/source/blender/gpu/GPU_immediate.h +++ b/source/blender/gpu/GPU_immediate.h @@ -58,30 +58,30 @@ GPUBatch *immBeginBatchAtMost(GPUPrimType, uint vertex_len); /* Provide attribute values that can change per vertex. */ /* First vertex after immBegin must have all its attributes specified. */ /* Skipped attributes will continue using the previous value for that attr_id. */ -void immAttrib1f(uint attr_id, float x); -void immAttrib2f(uint attr_id, float x, float y); -void immAttrib3f(uint attr_id, float x, float y, float z); -void immAttrib4f(uint attr_id, float x, float y, float z, float w); +void immAttr1f(uint attr_id, float x); +void immAttr2f(uint attr_id, float x, float y); +void immAttr3f(uint attr_id, float x, float y, float z); +void immAttr4f(uint attr_id, float x, float y, float z, float w); -void immAttrib2i(uint attr_id, int x, int y); +void immAttr2i(uint attr_id, int x, int y); -void immAttrib1u(uint attr_id, uint x); +void immAttr1u(uint attr_id, uint x); -void immAttrib2s(uint attr_id, short x, short y); +void immAttr2s(uint attr_id, short x, short y); -void immAttrib2fv(uint attr_id, const float data[2]); -void immAttrib3fv(uint attr_id, const float data[3]); -void immAttrib4fv(uint attr_id, const float data[4]); +void immAttr2fv(uint attr_id, const float data[2]); +void immAttr3fv(uint attr_id, const float data[3]); +void immAttr4fv(uint attr_id, const float data[4]); -void immAttrib3ub(uint attr_id, unsigned char r, unsigned char g, unsigned char b); -void immAttrib4ub(uint attr_id, unsigned char r, unsigned char g, unsigned char b, unsigned char a); +void immAttr3ub(uint attr_id, unsigned char r, unsigned char g, unsigned char b); +void immAttr4ub(uint attr_id, unsigned char r, unsigned char g, unsigned char b, unsigned char a); -void immAttrib3ubv(uint attr_id, const unsigned char data[4]); -void immAttrib4ubv(uint attr_id, const unsigned char data[4]); +void immAttr3ubv(uint attr_id, const unsigned char data[4]); +void immAttr4ubv(uint attr_id, const unsigned char data[4]); /* Explicitly skip an attribute. */ /* This advanced option kills automatic value copying for this attr_id. */ -void immSkipAttrib(uint attr_id); +void immAttrSkip(uint attr_id); /* Provide one last attribute value & end the current vertex. */ /* This is most often used for 2D or 3D position (similar to glVertex). */ diff --git a/source/blender/gpu/intern/gpu_immediate.c b/source/blender/gpu/intern/gpu_immediate.c index 0f22dc8d258..a71ba68821b 100644 --- a/source/blender/gpu/intern/gpu_immediate.c +++ b/source/blender/gpu/intern/gpu_immediate.c @@ -412,7 +412,7 @@ static void setAttribValueBit(uint attrib_id) /* --- generic attribute functions --- */ -void immAttrib1f(uint attrib_id, float x) +void immAttr1f(uint attrib_id, float x) { GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE @@ -430,7 +430,7 @@ void immAttrib1f(uint attrib_id, float x) data[0] = x; } -void immAttrib2f(uint attrib_id, float x, float y) +void immAttr2f(uint attrib_id, float x, float y) { GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE @@ -449,7 +449,7 @@ void immAttrib2f(uint attrib_id, float x, float y) data[1] = y; } -void immAttrib3f(uint attrib_id, float x, float y, float z) +void immAttr3f(uint attrib_id, float x, float y, float z) { GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE @@ -469,7 +469,7 @@ void immAttrib3f(uint attrib_id, float x, float y, float z) data[2] = z; } -void immAttrib4f(uint attrib_id, float x, float y, float z, float w) +void immAttr4f(uint attrib_id, float x, float y, float z, float w) { GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE @@ -490,7 +490,7 @@ void immAttrib4f(uint attrib_id, float x, float y, float z, float w) data[3] = w; } -void immAttrib1u(uint attrib_id, uint x) +void immAttr1u(uint attrib_id, uint x) { GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE @@ -507,7 +507,7 @@ void immAttrib1u(uint attrib_id, uint x) data[0] = x; } -void immAttrib2i(uint attrib_id, int x, int y) +void immAttr2i(uint attrib_id, int x, int y) { GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE @@ -525,7 +525,7 @@ void immAttrib2i(uint attrib_id, int x, int y) data[1] = y; } -void immAttrib2s(uint attrib_id, short x, short y) +void immAttr2s(uint attrib_id, short x, short y) { GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE @@ -543,22 +543,22 @@ void immAttrib2s(uint attrib_id, short x, short y) data[1] = y; } -void immAttrib2fv(uint attrib_id, const float data[2]) +void immAttr2fv(uint attrib_id, const float data[2]) { - immAttrib2f(attrib_id, data[0], data[1]); + immAttr2f(attrib_id, data[0], data[1]); } -void immAttrib3fv(uint attrib_id, const float data[3]) +void immAttr3fv(uint attrib_id, const float data[3]) { - immAttrib3f(attrib_id, data[0], data[1], data[2]); + immAttr3f(attrib_id, data[0], data[1], data[2]); } -void immAttrib4fv(uint attrib_id, const float data[4]) +void immAttr4fv(uint attrib_id, const float data[4]) { - immAttrib4f(attrib_id, data[0], data[1], data[2], data[3]); + immAttr4f(attrib_id, data[0], data[1], data[2], data[3]); } -void immAttrib3ub(uint attrib_id, uchar r, uchar g, uchar b) +void immAttr3ub(uint attrib_id, uchar r, uchar g, uchar b) { GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE @@ -578,7 +578,7 @@ void immAttrib3ub(uint attrib_id, uchar r, uchar g, uchar b) data[2] = b; } -void immAttrib4ub(uint attrib_id, uchar r, uchar g, uchar b, uchar a) +void immAttr4ub(uint attrib_id, uchar r, uchar g, uchar b, uchar a) { GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE @@ -599,17 +599,17 @@ void immAttrib4ub(uint attrib_id, uchar r, uchar g, uchar b, uchar a) data[3] = a; } -void immAttrib3ubv(uint attrib_id, const uchar data[3]) +void immAttr3ubv(uint attrib_id, const uchar data[3]) { - immAttrib3ub(attrib_id, data[0], data[1], data[2]); + immAttr3ub(attrib_id, data[0], data[1], data[2]); } -void immAttrib4ubv(uint attrib_id, const uchar data[4]) +void immAttr4ubv(uint attrib_id, const uchar data[4]) { - immAttrib4ub(attrib_id, data[0], data[1], data[2], data[3]); + immAttr4ub(attrib_id, data[0], data[1], data[2], data[3]); } -void immSkipAttrib(uint attrib_id) +void immAttrSkip(uint attrib_id) { #if TRUST_NO_ONE assert(attrib_id < imm.vertex_format.attr_len); @@ -652,49 +652,49 @@ static void immEndVertex(void) /* and move on to the next vertex */ void immVertex2f(uint attrib_id, float x, float y) { - immAttrib2f(attrib_id, x, y); + immAttr2f(attrib_id, x, y); immEndVertex(); } void immVertex3f(uint attrib_id, float x, float y, float z) { - immAttrib3f(attrib_id, x, y, z); + immAttr3f(attrib_id, x, y, z); immEndVertex(); } void immVertex4f(uint attrib_id, float x, float y, float z, float w) { - immAttrib4f(attrib_id, x, y, z, w); + immAttr4f(attrib_id, x, y, z, w); immEndVertex(); } void immVertex2i(uint attrib_id, int x, int y) { - immAttrib2i(attrib_id, x, y); + immAttr2i(attrib_id, x, y); immEndVertex(); } void immVertex2s(uint attrib_id, short x, short y) { - immAttrib2s(attrib_id, x, y); + immAttr2s(attrib_id, x, y); immEndVertex(); } void immVertex2fv(uint attrib_id, const float data[2]) { - immAttrib2f(attrib_id, data[0], data[1]); + immAttr2f(attrib_id, data[0], data[1]); immEndVertex(); } void immVertex3fv(uint attrib_id, const float data[3]) { - immAttrib3f(attrib_id, data[0], data[1], data[2]); + immAttr3f(attrib_id, data[0], data[1], data[2]); immEndVertex(); } void immVertex2iv(uint attrib_id, const int data[2]) { - immAttrib2i(attrib_id, data[0], data[1]); + immAttr2i(attrib_id, data[0], data[1]); immEndVertex(); } diff --git a/source/blender/gpu/intern/gpu_immediate_util.c b/source/blender/gpu/intern/gpu_immediate_util.c index d0f0c3aacce..983c70281a2 100644 --- a/source/blender/gpu/intern/gpu_immediate_util.c +++ b/source/blender/gpu/intern/gpu_immediate_util.c @@ -89,35 +89,35 @@ void immRecti(uint pos, int x1, int y1, int x2, int y2) void immRectf_fast_with_color(uint pos, uint col, float x1, float y1, float x2, float y2, const float color[4]) { - immAttrib4fv(col, color); + immAttr4fv(col, color); immVertex2f(pos, x1, y1); - immAttrib4fv(col, color); + immAttr4fv(col, color); immVertex2f(pos, x2, y1); - immAttrib4fv(col, color); + immAttr4fv(col, color); immVertex2f(pos, x2, y2); - immAttrib4fv(col, color); + immAttr4fv(col, color); immVertex2f(pos, x1, y1); - immAttrib4fv(col, color); + immAttr4fv(col, color); immVertex2f(pos, x2, y2); - immAttrib4fv(col, color); + immAttr4fv(col, color); immVertex2f(pos, x1, y2); } void immRecti_fast_with_color(uint pos, uint col, int x1, int y1, int x2, int y2, const float color[4]) { - immAttrib4fv(col, color); + immAttr4fv(col, color); immVertex2i(pos, x1, y1); - immAttrib4fv(col, color); + immAttr4fv(col, color); immVertex2i(pos, x2, y1); - immAttrib4fv(col, color); + immAttr4fv(col, color); immVertex2i(pos, x2, y2); - immAttrib4fv(col, color); + immAttr4fv(col, color); immVertex2i(pos, x1, y1); - immAttrib4fv(col, color); + immAttr4fv(col, color); immVertex2i(pos, x2, y2); - immAttrib4fv(col, color); + immAttr4fv(col, color); immVertex2i(pos, x1, y2); } @@ -425,16 +425,16 @@ void imm_draw_cylinder_fill_normal_3d( n2[0] = cos2; n2[1] = sin2; n2[2] = 1 - n2[2]; /* first tri */ - immAttrib3fv(nor, n2); + immAttr3fv(nor, n2); immVertex3fv(pos, v1); immVertex3fv(pos, v2); - immAttrib3fv(nor, n1); + immAttr3fv(nor, n1); immVertex3fv(pos, v3); /* second tri */ immVertex3fv(pos, v3); immVertex3fv(pos, v4); - immAttrib3fv(nor, n2); + immAttr3fv(nor, n2); immVertex3fv(pos, v1); } } |