diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-10-09 02:49:44 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-10-09 02:51:35 +0300 |
commit | 9b49a0d971c50d3316b8b752e6a9f35f67fd53c8 (patch) | |
tree | 466fc2965d4c779f26421cad1afc578d4252b913 /source/blender/gpu | |
parent | d43c776a566ad4218d24a5c58aa5adce3eacf764 (diff) |
Cleanup: naming
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/GPU_immediate.h | 50 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_immediate.c | 72 |
2 files changed, 61 insertions, 61 deletions
diff --git a/source/blender/gpu/GPU_immediate.h b/source/blender/gpu/GPU_immediate.h index c8a4ea6a837..516f9e60d12 100644 --- a/source/blender/gpu/GPU_immediate.h +++ b/source/blender/gpu/GPU_immediate.h @@ -57,46 +57,46 @@ 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 attrib_id. */ -void immAttrib1f(uint attrib_id, float x); -void immAttrib2f(uint attrib_id, float x, float y); -void immAttrib3f(uint attrib_id, float x, float y, float z); -void immAttrib4f(uint attrib_id, float x, float y, float z, float w); +/* 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 immAttrib2i(uint attrib_id, int x, int y); +void immAttrib2i(uint attr_id, int x, int y); -void immAttrib1u(uint attrib_id, uint x); +void immAttrib1u(uint attr_id, uint x); -void immAttrib2s(uint attrib_id, short x, short y); +void immAttrib2s(uint attr_id, short x, short y); -void immAttrib2fv(uint attrib_id, const float data[2]); -void immAttrib3fv(uint attrib_id, const float data[3]); -void immAttrib4fv(uint attrib_id, const float data[4]); +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 immAttrib3ub(uint attrib_id, unsigned char r, unsigned char g, unsigned char b); -void immAttrib4ub(uint attrib_id, unsigned char r, unsigned char g, unsigned char b, unsigned char a); +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 immAttrib3ubv(uint attrib_id, const unsigned char data[4]); -void immAttrib4ubv(uint attrib_id, const unsigned char data[4]); +void immAttrib3ubv(uint attr_id, const unsigned char data[4]); +void immAttrib4ubv(uint attr_id, const unsigned char data[4]); /* Explicitly skip an attribute. */ -/* This advanced option kills automatic value copying for this attrib_id. */ -void immSkipAttrib(uint attrib_id); +/* This advanced option kills automatic value copying for this attr_id. */ +void immSkipAttrib(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). */ -void immVertex2f(uint attrib_id, float x, float y); -void immVertex3f(uint attrib_id, float x, float y, float z); -void immVertex4f(uint attrib_id, float x, float y, float z, float w); +void immVertex2f(uint attr_id, float x, float y); +void immVertex3f(uint attr_id, float x, float y, float z); +void immVertex4f(uint attr_id, float x, float y, float z, float w); -void immVertex2i(uint attrib_id, int x, int y); +void immVertex2i(uint attr_id, int x, int y); -void immVertex2s(uint attrib_id, short x, short y); +void immVertex2s(uint attr_id, short x, short y); -void immVertex2fv(uint attrib_id, const float data[2]); -void immVertex3fv(uint attrib_id, const float data[3]); +void immVertex2fv(uint attr_id, const float data[2]); +void immVertex3fv(uint attr_id, const float data[3]); -void immVertex2iv(uint attrib_id, const int data[2]); +void immVertex2iv(uint attr_id, const int data[2]); /* Provide uniform values that don't change for the entire draw call. */ void immUniform1i(const char *name, int x); diff --git a/source/blender/gpu/intern/gpu_immediate.c b/source/blender/gpu/intern/gpu_immediate.c index 6e3de51df6b..0f22dc8d258 100644 --- a/source/blender/gpu/intern/gpu_immediate.c +++ b/source/blender/gpu/intern/gpu_immediate.c @@ -414,17 +414,17 @@ static void setAttribValueBit(uint attrib_id) void immAttrib1f(uint attrib_id, float x) { - GPUVertAttr *attrib = imm.vertex_format.attribs + attrib_id; + GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE assert(attrib_id < imm.vertex_format.attr_len); - assert(attrib->comp_type == GPU_COMP_F32); - assert(attrib->comp_len == 1); + assert(attr->comp_type == GPU_COMP_F32); + assert(attr->comp_len == 1); assert(imm.vertex_idx < imm.vertex_len); assert(imm.prim_type != GPU_PRIM_NONE); /* make sure we're between a Begin/End pair */ #endif setAttribValueBit(attrib_id); - float *data = (float *)(imm.vertex_data + attrib->offset); + float *data = (float *)(imm.vertex_data + attr->offset); /* printf("%s %td %p\n", __FUNCTION__, (GLubyte*)data - imm.buffer_data, data); */ data[0] = x; @@ -432,17 +432,17 @@ void immAttrib1f(uint attrib_id, float x) void immAttrib2f(uint attrib_id, float x, float y) { - GPUVertAttr *attrib = imm.vertex_format.attribs + attrib_id; + GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE assert(attrib_id < imm.vertex_format.attr_len); - assert(attrib->comp_type == GPU_COMP_F32); - assert(attrib->comp_len == 2); + assert(attr->comp_type == GPU_COMP_F32); + assert(attr->comp_len == 2); assert(imm.vertex_idx < imm.vertex_len); assert(imm.prim_type != GPU_PRIM_NONE); /* make sure we're between a Begin/End pair */ #endif setAttribValueBit(attrib_id); - float *data = (float *)(imm.vertex_data + attrib->offset); + float *data = (float *)(imm.vertex_data + attr->offset); /* printf("%s %td %p\n", __FUNCTION__, (GLubyte*)data - imm.buffer_data, data); */ data[0] = x; @@ -451,17 +451,17 @@ void immAttrib2f(uint attrib_id, float x, float y) void immAttrib3f(uint attrib_id, float x, float y, float z) { - GPUVertAttr *attrib = imm.vertex_format.attribs + attrib_id; + GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE assert(attrib_id < imm.vertex_format.attr_len); - assert(attrib->comp_type == GPU_COMP_F32); - assert(attrib->comp_len == 3); + assert(attr->comp_type == GPU_COMP_F32); + assert(attr->comp_len == 3); assert(imm.vertex_idx < imm.vertex_len); assert(imm.prim_type != GPU_PRIM_NONE); /* make sure we're between a Begin/End pair */ #endif setAttribValueBit(attrib_id); - float *data = (float *)(imm.vertex_data + attrib->offset); + float *data = (float *)(imm.vertex_data + attr->offset); /* printf("%s %td %p\n", __FUNCTION__, (GLubyte*)data - imm.buffer_data, data); */ data[0] = x; @@ -471,17 +471,17 @@ void immAttrib3f(uint attrib_id, float x, float y, float z) void immAttrib4f(uint attrib_id, float x, float y, float z, float w) { - GPUVertAttr *attrib = imm.vertex_format.attribs + attrib_id; + GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE assert(attrib_id < imm.vertex_format.attr_len); - assert(attrib->comp_type == GPU_COMP_F32); - assert(attrib->comp_len == 4); + assert(attr->comp_type == GPU_COMP_F32); + assert(attr->comp_len == 4); assert(imm.vertex_idx < imm.vertex_len); assert(imm.prim_type != GPU_PRIM_NONE); /* make sure we're between a Begin/End pair */ #endif setAttribValueBit(attrib_id); - float *data = (float *)(imm.vertex_data + attrib->offset); + float *data = (float *)(imm.vertex_data + attr->offset); /* printf("%s %td %p\n", __FUNCTION__, (GLubyte*)data - imm.buffer_data, data); */ data[0] = x; @@ -492,34 +492,34 @@ void immAttrib4f(uint attrib_id, float x, float y, float z, float w) void immAttrib1u(uint attrib_id, uint x) { - GPUVertAttr *attrib = imm.vertex_format.attribs + attrib_id; + GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE assert(attrib_id < imm.vertex_format.attr_len); - assert(attrib->comp_type == GPU_COMP_U32); - assert(attrib->comp_len == 1); + assert(attr->comp_type == GPU_COMP_U32); + assert(attr->comp_len == 1); assert(imm.vertex_idx < imm.vertex_len); assert(imm.prim_type != GPU_PRIM_NONE); /* make sure we're between a Begin/End pair */ #endif setAttribValueBit(attrib_id); - uint *data = (uint *)(imm.vertex_data + attrib->offset); + uint *data = (uint *)(imm.vertex_data + attr->offset); data[0] = x; } void immAttrib2i(uint attrib_id, int x, int y) { - GPUVertAttr *attrib = imm.vertex_format.attribs + attrib_id; + GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE assert(attrib_id < imm.vertex_format.attr_len); - assert(attrib->comp_type == GPU_COMP_I32); - assert(attrib->comp_len == 2); + assert(attr->comp_type == GPU_COMP_I32); + assert(attr->comp_len == 2); assert(imm.vertex_idx < imm.vertex_len); assert(imm.prim_type != GPU_PRIM_NONE); /* make sure we're between a Begin/End pair */ #endif setAttribValueBit(attrib_id); - int *data = (int *)(imm.vertex_data + attrib->offset); + int *data = (int *)(imm.vertex_data + attr->offset); data[0] = x; data[1] = y; @@ -527,17 +527,17 @@ void immAttrib2i(uint attrib_id, int x, int y) void immAttrib2s(uint attrib_id, short x, short y) { - GPUVertAttr *attrib = imm.vertex_format.attribs + attrib_id; + GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE assert(attrib_id < imm.vertex_format.attr_len); - assert(attrib->comp_type == GPU_COMP_I16); - assert(attrib->comp_len == 2); + assert(attr->comp_type == GPU_COMP_I16); + assert(attr->comp_len == 2); assert(imm.vertex_idx < imm.vertex_len); assert(imm.prim_type != GPU_PRIM_NONE); /* make sure we're between a Begin/End pair */ #endif setAttribValueBit(attrib_id); - short *data = (short *)(imm.vertex_data + attrib->offset); + short *data = (short *)(imm.vertex_data + attr->offset); data[0] = x; data[1] = y; @@ -560,17 +560,17 @@ void immAttrib4fv(uint attrib_id, const float data[4]) void immAttrib3ub(uint attrib_id, uchar r, uchar g, uchar b) { - GPUVertAttr *attrib = imm.vertex_format.attribs + attrib_id; + GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE assert(attrib_id < imm.vertex_format.attr_len); - assert(attrib->comp_type == GPU_COMP_U8); - assert(attrib->comp_len == 3); + assert(attr->comp_type == GPU_COMP_U8); + assert(attr->comp_len == 3); assert(imm.vertex_idx < imm.vertex_len); assert(imm.prim_type != GPU_PRIM_NONE); /* make sure we're between a Begin/End pair */ #endif setAttribValueBit(attrib_id); - GLubyte *data = imm.vertex_data + attrib->offset; + GLubyte *data = imm.vertex_data + attr->offset; /* printf("%s %td %p\n", __FUNCTION__, data - imm.buffer_data, data); */ data[0] = r; @@ -580,17 +580,17 @@ void immAttrib3ub(uint attrib_id, uchar r, uchar g, uchar b) void immAttrib4ub(uint attrib_id, uchar r, uchar g, uchar b, uchar a) { - GPUVertAttr *attrib = imm.vertex_format.attribs + attrib_id; + GPUVertAttr *attr = imm.vertex_format.attribs + attrib_id; #if TRUST_NO_ONE assert(attrib_id < imm.vertex_format.attr_len); - assert(attrib->comp_type == GPU_COMP_U8); - assert(attrib->comp_len == 4); + assert(attr->comp_type == GPU_COMP_U8); + assert(attr->comp_len == 4); assert(imm.vertex_idx < imm.vertex_len); assert(imm.prim_type != GPU_PRIM_NONE); /* make sure we're between a Begin/End pair */ #endif setAttribValueBit(attrib_id); - GLubyte *data = imm.vertex_data + attrib->offset; + GLubyte *data = imm.vertex_data + attr->offset; /* printf("%s %td %p\n", __FUNCTION__, data - imm.buffer_data, data); */ data[0] = r; |