Python GPU: Improve the Python GPU API documentation

This fixes some errors of continuity and consistency of formatting on
https://docs.blender.org/api/current/gpu.html

This also details the description of some parameters.

Differential Revision: https://developer.blender.org/D10531
This commit is contained in:
2021-03-16 12:48:00 -03:00
parent 6b6bcbe60c
commit b71b1ae384
11 changed files with 88 additions and 112 deletions

View File

@@ -295,18 +295,10 @@ PyDoc_STRVAR(
"\n" "\n"
" Reusable container for drawable geometry.\n" " Reusable container for drawable geometry.\n"
"\n" "\n"
" :arg type: One of these primitive types: {\n" " :arg type: The primitive type of geometry to be drawn.\n"
" `POINTS`,\n" " Possible values are `POINTS`, `LINES`, `TRIS`, `LINE_STRIP`, `LINE_LOOP`, `TRI_STRIP`, "
" `LINES`,\n" "`TRI_FAN`, `LINES_ADJ`, `TRIS_ADJ` and `LINE_STRIP_ADJ`.\n"
" `TRIS`,\n" " :type type: str\n"
" `LINE_STRIP`,\n"
" `LINE_LOOP`,\n"
" `TRI_STRIP`,\n"
" `TRI_FAN`,\n"
" `LINES_ADJ`,\n"
" `TRIS_ADJ`,\n"
" `LINE_STRIP_ADJ` }\n"
" :type type: `str`\n"
" :arg buf: Vertex buffer containing all or some of the attributes required for drawing.\n" " :arg buf: Vertex buffer containing all or some of the attributes required for drawing.\n"
" :type buf: :class:`gpu.types.GPUVertBuf`\n" " :type buf: :class:`gpu.types.GPUVertBuf`\n"
" :arg elem: An optional index buffer.\n" " :arg elem: An optional index buffer.\n"

View File

@@ -589,23 +589,19 @@ static PyBufferProcs pygpu_buffer__tp_as_buffer = {
}; };
#endif #endif
PyDoc_STRVAR(pygpu_buffer__tp_doc, PyDoc_STRVAR(
".. class:: Buffer(format, dimensions, data)\n" pygpu_buffer__tp_doc,
"\n" ".. class:: Buffer(format, dimensions, data)\n"
" For Python access to GPU functions requiring a pointer.\n" "\n"
"\n" " For Python access to GPU functions requiring a pointer.\n"
" :arg format: One of these primitive types: {\n" "\n"
" `FLOAT`,\n" " :arg format: Format type to interpret the buffer.\n"
" `INT`,\n" " Possible values are `FLOAT`, `INT`, `UINT`, `UBYTE`, `UINT_24_8` and `10_11_11_REV`.\n"
" `UINT`,\n" " :type type: str\n"
" `UBYTE`,\n" " :arg dimensions: Array describing the dimensions.\n"
" `UINT_24_8`,\n" " :type dimensions: int\n"
" `10_11_11_REV`,\n" " :arg data: Optional data array.\n"
" :type type: `str`\n" " :type data: sequence\n");
" :arg dimensions: Array describing the dimensions.\n"
" :type dimensions: `int`\n"
" :arg data: Optional data array.\n"
" :type data: `array`\n");
PyTypeObject BPyGPU_BufferType = { PyTypeObject BPyGPU_BufferType = {
PyVarObject_HEAD_INIT(NULL, 0).tp_name = "Buffer", PyVarObject_HEAD_INIT(NULL, 0).tp_name = "Buffer",
.tp_basicsize = sizeof(BPyGPUBuffer), .tp_basicsize = sizeof(BPyGPUBuffer),

View File

@@ -184,12 +184,9 @@ PyDoc_STRVAR(pygpu_IndexBuf__tp_doc,
"\n" "\n"
" Contains an index buffer.\n" " Contains an index buffer.\n"
"\n" "\n"
" :param type: One of these primitive types: {\n" " :arg type: The primitive type this index buffer is composed of.\n"
" `POINTS`,\n" " Possible values are `POINTS`, `LINES`, `TRIS` and `LINE_STRIP_ADJ`.\n"
" `LINES`,\n" " :type type: str\n"
" `TRIS`,\n"
" `LINE_STRIP_ADJ` }\n"
" :type type: `str`\n"
" :param seq: Indices this index buffer will contain.\n" " :param seq: Indices this index buffer will contain.\n"
" Whether a 1D or 2D sequence is required depends on the type.\n" " Whether a 1D or 2D sequence is required depends on the type.\n"
" Optionally the sequence can support the buffer protocol.\n" " Optionally the sequence can support the buffer protocol.\n"

View File

@@ -356,9 +356,9 @@ PyDoc_STRVAR(pygpu_framebuffer_clear_doc,
" :arg color: float sequence each representing ``(r, g, b, a)``.\n" " :arg color: float sequence each representing ``(r, g, b, a)``.\n"
" :type color: sequence of 3 or 4 floats\n" " :type color: sequence of 3 or 4 floats\n"
" :arg depth: depth value.\n" " :arg depth: depth value.\n"
" :type depth: `float`\n" " :type depth: float\n"
" :arg stencil: stencil value.\n" " :arg stencil: stencil value.\n"
" :type stencil: `int`\n"); " :type stencil: int\n");
static PyObject *pygpu_framebuffer_clear(BPyGPUFrameBuffer *self, PyObject *args, PyObject *kwds) static PyObject *pygpu_framebuffer_clear(BPyGPUFrameBuffer *self, PyObject *args, PyObject *kwds)
{ {
PYGPU_FRAMEBUFFER_CHECK_OBJ(self); PYGPU_FRAMEBUFFER_CHECK_OBJ(self);
@@ -417,7 +417,7 @@ PyDoc_STRVAR(pygpu_framebuffer_viewport_set_doc,
"\n" "\n"
" :param x, y: lower left corner of the viewport_set rectangle, in pixels.\n" " :param x, y: lower left corner of the viewport_set rectangle, in pixels.\n"
" :param xsize, ysize: width and height of the viewport_set.\n" " :param xsize, ysize: width and height of the viewport_set.\n"
" :type x, y, xsize, ysize: `int`\n"); " :type x, y, xsize, ysize: int\n");
static PyObject *pygpu_framebuffer_viewport_set(BPyGPUFrameBuffer *self, static PyObject *pygpu_framebuffer_viewport_set(BPyGPUFrameBuffer *self,
PyObject *args, PyObject *args,
void *UNUSED(type)) void *UNUSED(type))
@@ -510,10 +510,10 @@ PyDoc_STRVAR(pygpu_framebuffer__tp_doc,
"\n" "\n"
" :arg depth_slot: GPUTexture to attach or a `dict` containing keywords: " " :arg depth_slot: GPUTexture to attach or a `dict` containing keywords: "
"'texture', 'layer' and 'mip'.\n" "'texture', 'layer' and 'mip'.\n"
" :type depth_slot: :class:`gpu.types.GPUTexture`, `dict` or `Nonetype`\n" " :type depth_slot: :class:`gpu.types.GPUTexture`, dict or Nonetype\n"
" :arg color_slots: Tuple where each item can be a GPUTexture or a `dict` " " :arg color_slots: Tuple where each item can be a GPUTexture or a `dict` "
"containing keywords: 'texture', 'layer' and 'mip'.\n" "containing keywords: 'texture', 'layer' and 'mip'.\n"
" :type color_slots: `tuple` or `Nonetype`\n"); " :type color_slots: tuple or Nonetype\n");
PyTypeObject BPyGPUFrameBuffer_Type = { PyTypeObject BPyGPUFrameBuffer_Type = {
PyVarObject_HEAD_INIT(NULL, 0).tp_name = "GPUFrameBuffer", PyVarObject_HEAD_INIT(NULL, 0).tp_name = "GPUFrameBuffer",
.tp_basicsize = sizeof(BPyGPUFrameBuffer), .tp_basicsize = sizeof(BPyGPUFrameBuffer),

View File

@@ -184,7 +184,7 @@ PyDoc_STRVAR(pygpu_offscreen_unbind_doc,
"\n" "\n"
" :arg restore: Restore the OpenGL state, can only be used when the state has been " " :arg restore: Restore the OpenGL state, can only be used when the state has been "
"saved before.\n" "saved before.\n"
" :type restore: `bool`\n"); " :type restore: bool\n");
static PyObject *pygpu_offscreen_unbind(BPyGPUOffScreen *self, PyObject *args, PyObject *kwds) static PyObject *pygpu_offscreen_unbind(BPyGPUOffScreen *self, PyObject *args, PyObject *kwds)
{ {
bool restore = true; bool restore = true;
@@ -412,9 +412,9 @@ PyDoc_STRVAR(pygpu_offscreen__tp_doc,
" This object gives access to off screen buffers.\n" " This object gives access to off screen buffers.\n"
"\n" "\n"
" :arg width: Horizontal dimension of the buffer.\n" " :arg width: Horizontal dimension of the buffer.\n"
" :type width: `int`\n" " :type width: int\n"
" :arg height: Vertical dimension of the buffer.\n" " :arg height: Vertical dimension of the buffer.\n"
" :type height: `int`\n"); " :type height: int\n");
PyTypeObject BPyGPUOffScreen_Type = { PyTypeObject BPyGPUOffScreen_Type = {
PyVarObject_HEAD_INIT(NULL, 0).tp_name = "GPUOffScreen", PyVarObject_HEAD_INIT(NULL, 0).tp_name = "GPUOffScreen",
.tp_basicsize = sizeof(BPyGPUOffScreen), .tp_basicsize = sizeof(BPyGPUOffScreen),

View File

@@ -130,9 +130,9 @@ PyDoc_STRVAR(pygpu_shader_uniform_from_name_doc,
" Get uniform location by name.\n" " Get uniform location by name.\n"
"\n" "\n"
" :param name: Name of the uniform variable whose location is to be queried.\n" " :param name: Name of the uniform variable whose location is to be queried.\n"
" :type name: `str`\n" " :type name: str\n"
" :return: Location of the uniform variable.\n" " :return: Location of the uniform variable.\n"
" :rtype: `int`\n"); " :rtype: int\n");
static PyObject *pygpu_shader_uniform_from_name(BPyGPUShader *self, PyObject *arg) static PyObject *pygpu_shader_uniform_from_name(BPyGPUShader *self, PyObject *arg)
{ {
const char *name = PyUnicode_AsUTF8(arg); const char *name = PyUnicode_AsUTF8(arg);
@@ -157,9 +157,9 @@ PyDoc_STRVAR(
" Get uniform block location by name.\n" " Get uniform block location by name.\n"
"\n" "\n"
" :param name: Name of the uniform block variable whose location is to be queried.\n" " :param name: Name of the uniform block variable whose location is to be queried.\n"
" :type name: `str`\n" " :type name: str\n"
" :return: The location of the uniform block variable.\n" " :return: The location of the uniform block variable.\n"
" :rtype: `int`\n"); " :rtype: int\n");
static PyObject *pygpu_shader_uniform_block_from_name(BPyGPUShader *self, PyObject *arg) static PyObject *pygpu_shader_uniform_block_from_name(BPyGPUShader *self, PyObject *arg)
{ {
const char *name = PyUnicode_AsUTF8(arg); const char *name = PyUnicode_AsUTF8(arg);
@@ -559,7 +559,7 @@ PyDoc_STRVAR(pygpu_shader_calc_format_doc,
" Build a new format based on the attributes of the shader.\n" " Build a new format based on the attributes of the shader.\n"
"\n" "\n"
" :return: vertex attribute format for the shader\n" " :return: vertex attribute format for the shader\n"
" :rtype: GPUVertFormat\n"); " :rtype: :class:`gpu.types.GPUVertFormat`\n");
static PyObject *pygpu_shader_calc_format(BPyGPUShader *self, PyObject *UNUSED(arg)) static PyObject *pygpu_shader_calc_format(BPyGPUShader *self, PyObject *UNUSED(arg))
{ {
BPyGPUVertFormat *ret = (BPyGPUVertFormat *)BPyGPUVertFormat_CreatePyObject(NULL); BPyGPUVertFormat *ret = (BPyGPUVertFormat *)BPyGPUVertFormat_CreatePyObject(NULL);

View File

@@ -78,24 +78,27 @@ static const struct PyC_StringEnumItems pygpu_state_faceculling_items[] = {
/** \name Manage Stack /** \name Manage Stack
* \{ */ * \{ */
PyDoc_STRVAR(pygpu_state_blend_set_doc, PyDoc_STRVAR(
".. function:: blend_set(mode)\n" pygpu_state_blend_set_doc,
"\n" ".. function:: blend_set(mode)\n"
" Defines the fixed pipeline blending equation.\n" "\n"
"\n" " Defines the fixed pipeline blending equation.\n"
" :param mode: One of these modes: {\n" "\n"
" `NONE`,\n" " :param mode: The type of blend mode.\n"
" `ALPHA`,\n" " * ``NONE`` No blending.\n"
" `ALPHA_PREMULT`,\n" " * ``ALPHA`` The original color channels are interpolated according to the alpha value.\n"
" `ADDITIVE`,\n" " * ``ALPHA_PREMULT`` The original color channels are interpolated according to the alpha "
" `ADDITIVE_PREMULT`,\n" "value with the new colors pre-multiplied by this value.\n"
" `MULTIPLY`,\n" " * ``ADDITIVE`` The original color channels are added by the corresponding ones.\n"
" `SUBTRACT`,\n" " * ``ADDITIVE_PREMULT`` The original color channels are added by the corresponding ones "
" `INVERT`,\n" "that are pre-multiplied by the alpha value.\n"
//" `OIT`,\n" " * ``MULTIPLY`` The original color channels are multiplied by the corresponding ones.\n"
//" `BACKGROUND`,\n" " * ``SUBTRACT`` The original color channels are subtracted by the corresponding ones.\n"
//" `CUSTOM`,\n" " * ``INVERT`` The original color channels are replaced by its complementary color.\n"
" :type mode: `str`\n"); //" * ``OIT``.\n"
//" * ``BACKGROUND`` .\n"
//" * ``CUSTOM`` .\n"
" :type mode: str\n");
static PyObject *pygpu_state_blend_set(PyObject *UNUSED(self), PyObject *value) static PyObject *pygpu_state_blend_set(PyObject *UNUSED(self), PyObject *value)
{ {
struct PyC_StringEnum pygpu_blend = {pygpu_state_blend_items}; struct PyC_StringEnum pygpu_blend = {pygpu_state_blend_items};
@@ -122,15 +125,10 @@ PyDoc_STRVAR(pygpu_state_depth_test_set_doc,
"\n" "\n"
" Defines the depth_test equation.\n" " Defines the depth_test equation.\n"
"\n" "\n"
" :param mode: One of these modes: {\n" " :param mode: The depth test equation name.\n"
" `NONE`,\n" " Possible values are `NONE`, `ALWAYS`, `LESS`, `LESS_EQUAL`, `EQUAL`, "
" `ALWAYS`,\n" "`GREATER` and `GREATER_EQUAL`.\n"
" `LESS`,\n" " :type mode: str\n");
" `LESS_EQUAL`,\n"
" `EQUAL`,\n"
" `GREATER`,\n"
" `GREATER_EQUAL`,\n"
" :type mode: `str`\n");
static PyObject *pygpu_state_depth_test_set(PyObject *UNUSED(self), PyObject *value) static PyObject *pygpu_state_depth_test_set(PyObject *UNUSED(self), PyObject *value)
{ {
struct PyC_StringEnum pygpu_depth_test = {pygpu_state_depthtest_items}; struct PyC_StringEnum pygpu_depth_test = {pygpu_state_depthtest_items};
@@ -158,7 +156,7 @@ PyDoc_STRVAR(pygpu_state_depth_mask_set_doc,
" Write to depth component.\n" " Write to depth component.\n"
"\n" "\n"
" :param value: True for writing to the depth component.\n" " :param value: True for writing to the depth component.\n"
" :type near: `bool`\n"); " :type near: bool\n");
static PyObject *pygpu_state_depth_mask_set(PyObject *UNUSED(self), PyObject *value) static PyObject *pygpu_state_depth_mask_set(PyObject *UNUSED(self), PyObject *value)
{ {
bool write_to_depth; bool write_to_depth;
@@ -186,7 +184,7 @@ PyDoc_STRVAR(pygpu_state_viewport_set_doc,
"\n" "\n"
" :param x, y: lower left corner of the viewport_set rectangle, in pixels.\n" " :param x, y: lower left corner of the viewport_set rectangle, in pixels.\n"
" :param width, height: width and height of the viewport_set.\n" " :param width, height: width and height of the viewport_set.\n"
" :type x, y, xsize, ysize: `int`\n"); " :type x, y, xsize, ysize: int\n");
static PyObject *pygpu_state_viewport_set(PyObject *UNUSED(self), PyObject *args) static PyObject *pygpu_state_viewport_set(PyObject *UNUSED(self), PyObject *args)
{ {
int x, y, xsize, ysize; int x, y, xsize, ysize;
@@ -222,7 +220,7 @@ PyDoc_STRVAR(pygpu_state_line_width_set_doc,
" Specify the width of rasterized lines.\n" " Specify the width of rasterized lines.\n"
"\n" "\n"
" :param size: New width.\n" " :param size: New width.\n"
" :type mode: `float`\n"); " :type mode: float\n");
static PyObject *pygpu_state_line_width_set(PyObject *UNUSED(self), PyObject *value) static PyObject *pygpu_state_line_width_set(PyObject *UNUSED(self), PyObject *value)
{ {
float width = (float)PyFloat_AsDouble(value); float width = (float)PyFloat_AsDouble(value);
@@ -250,7 +248,7 @@ PyDoc_STRVAR(pygpu_state_point_size_set_doc,
" Specify the diameter of rasterized points.\n" " Specify the diameter of rasterized points.\n"
"\n" "\n"
" :param size: New diameter.\n" " :param size: New diameter.\n"
" :type mode: `float`\n"); " :type mode: float\n");
static PyObject *pygpu_state_point_size_set(PyObject *UNUSED(self), PyObject *value) static PyObject *pygpu_state_point_size_set(PyObject *UNUSED(self), PyObject *value)
{ {
float size = (float)PyFloat_AsDouble(value); float size = (float)PyFloat_AsDouble(value);
@@ -268,7 +266,7 @@ PyDoc_STRVAR(pygpu_state_color_mask_set_doc,
" Enable or disable writing of frame buffer color components.\n" " Enable or disable writing of frame buffer color components.\n"
"\n" "\n"
" :param r, g, b, a: components red, green, blue, and alpha.\n" " :param r, g, b, a: components red, green, blue, and alpha.\n"
" :type r, g, b, a: `bool`\n"); " :type r, g, b, a: bool\n");
static PyObject *pygpu_state_color_mask_set(PyObject *UNUSED(self), PyObject *args) static PyObject *pygpu_state_color_mask_set(PyObject *UNUSED(self), PyObject *args)
{ {
int r, g, b, a; int r, g, b, a;
@@ -285,11 +283,8 @@ PyDoc_STRVAR(pygpu_state_face_culling_set_doc,
"\n" "\n"
" Specify whether none, front-facing or back-facing facets can be culled.\n" " Specify whether none, front-facing or back-facing facets can be culled.\n"
"\n" "\n"
" :param mode: One of these modes: {\n" " :param mode: `NONE`, `FRONT` or `BACK`.\n"
" `NONE`,\n" " :type mode: str\n");
" `FRONT`,\n"
" `BACK`,\n"
" :type mode: `str`\n");
static PyObject *pygpu_state_face_culling_set(PyObject *UNUSED(self), PyObject *value) static PyObject *pygpu_state_face_culling_set(PyObject *UNUSED(self), PyObject *value)
{ {
struct PyC_StringEnum pygpu_faceculling = {pygpu_state_faceculling_items}; struct PyC_StringEnum pygpu_faceculling = {pygpu_state_faceculling_items};
@@ -307,7 +302,7 @@ PyDoc_STRVAR(pygpu_state_front_facing_set_doc,
" Specifies the orientation of front-facing polygons.\n" " Specifies the orientation of front-facing polygons.\n"
"\n" "\n"
" :param invert: True for clockwise polygons as front-facing.\n" " :param invert: True for clockwise polygons as front-facing.\n"
" :type mode: `bool`\n"); " :type mode: bool\n");
static PyObject *pygpu_state_front_facing_set(PyObject *UNUSED(self), PyObject *value) static PyObject *pygpu_state_front_facing_set(PyObject *UNUSED(self), PyObject *value)
{ {
bool invert; bool invert;
@@ -326,7 +321,7 @@ PyDoc_STRVAR(pygpu_state_program_point_size_set_doc,
"shader builtin gl_PointSize.\n" "shader builtin gl_PointSize.\n"
"\n" "\n"
" :param enable: True for shader builtin gl_PointSize.\n" " :param enable: True for shader builtin gl_PointSize.\n"
" :type enable: `bool`\n"); " :type enable: bool\n");
static PyObject *pygpu_state_program_point_size_set(PyObject *UNUSED(self), PyObject *value) static PyObject *pygpu_state_program_point_size_set(PyObject *UNUSED(self), PyObject *value)
{ {
bool enable; bool enable;

View File

@@ -272,21 +272,17 @@ static PyObject *pygpu_texture_format_get(BPyGPUTexture *self, void *UNUSED(type
return PyUnicode_FromString(PyC_StringEnum_FindIDFromValue(pygpu_textureformat_items, format)); return PyUnicode_FromString(PyC_StringEnum_FindIDFromValue(pygpu_textureformat_items, format));
} }
PyDoc_STRVAR(pygpu_texture_clear_doc, PyDoc_STRVAR(
".. method:: clear(format='FLOAT', value=(0.0, 0.0, 0.0, 1.0))\n" pygpu_texture_clear_doc,
"\n" ".. method:: clear(format='FLOAT', value=(0.0, 0.0, 0.0, 1.0))\n"
" Fill texture with specific value.\n" "\n"
"\n" " Fill texture with specific value.\n"
" :param format: One of these primitive types: {\n" "\n"
" `FLOAT`,\n" " :param format: The format that describes the content of a single item.\n"
" `INT`,\n" " Possible values are `FLOAT`, `INT`, `UINT`, `UBYTE`, `UINT_24_8` and `10_11_11_REV`.\n"
" `UINT`,\n" " :type type: str\n"
" `UBYTE`,\n" " :arg value: sequence each representing the value to fill.\n"
" `UINT_24_8`,\n" " :type value: sequence of 1, 2, 3 or 4 values\n");
" `10_11_11_REV`,\n"
" :type type: `str`\n"
" :arg value: sequence each representing the value to fill.\n"
" :type value: sequence of 1, 2, 3 or 4 values\n");
static PyObject *pygpu_texture_clear(BPyGPUTexture *self, PyObject *args, PyObject *kwds) static PyObject *pygpu_texture_clear(BPyGPUTexture *self, PyObject *args, PyObject *kwds)
{ {
BPYGPU_TEXTURE_CHECK_OBJ(self); BPYGPU_TEXTURE_CHECK_OBJ(self);
@@ -447,12 +443,12 @@ PyDoc_STRVAR(
" This object gives access to off GPU textures.\n" " This object gives access to off GPU textures.\n"
"\n" "\n"
" :arg size: Dimensions of the texture 1D, 2D, 3D or cubemap.\n" " :arg size: Dimensions of the texture 1D, 2D, 3D or cubemap.\n"
" :type size: `tuple` or `int`\n" " :type size: tuple or int\n"
" :arg layers: Number of layers in texture array or number of cubemaps in cubemap array\n" " :arg layers: Number of layers in texture array or number of cubemaps in cubemap array\n"
" :type layers: `int`\n" " :type layers: int\n"
" :arg is_cubemap: Indicates the creation of a cubemap texture.\n" " :arg is_cubemap: Indicates the creation of a cubemap texture.\n"
" :type is_cubemap: `int`\n" " :type is_cubemap: int\n"
" :arg format: One of these primitive types: {\n" " :arg format: Internal data format inside GPU memory. Possible values are:\n"
" `RGBA8UI`,\n" " `RGBA8UI`,\n"
" `RGBA8I`,\n" " `RGBA8I`,\n"
" `RGBA8`,\n" " `RGBA8`,\n"
@@ -497,9 +493,9 @@ PyDoc_STRVAR(
" `DEPTH_COMPONENT32F`,\n" " `DEPTH_COMPONENT32F`,\n"
" `DEPTH_COMPONENT24`,\n" " `DEPTH_COMPONENT24`,\n"
" `DEPTH_COMPONENT16`,\n" " `DEPTH_COMPONENT16`,\n"
" :type format: `str`\n" " :type format: str\n"
" :arg data: Buffer object to fill the texture.\n" " :arg data: Buffer object to fill the texture.\n"
" :type data: `Buffer`\n"); " :type data: :class:`gpu.types.Buffer`\n");
PyTypeObject BPyGPUTexture_Type = { PyTypeObject BPyGPUTexture_Type = {
PyVarObject_HEAD_INIT(NULL, 0).tp_name = "GPUTexture", PyVarObject_HEAD_INIT(NULL, 0).tp_name = "GPUTexture",
.tp_basicsize = sizeof(BPyGPUTexture), .tp_basicsize = sizeof(BPyGPUTexture),

View File

@@ -161,7 +161,7 @@ PyDoc_STRVAR(pygpu_uniformbuffer__tp_doc,
" This object gives access to off uniform buffers.\n" " This object gives access to off uniform buffers.\n"
"\n" "\n"
" :arg data: Buffer object.\n" " :arg data: Buffer object.\n"
" :type data: `Buffer`\n"); " :type data: :class:`gpu.types.Buffer`\n");
PyTypeObject BPyGPUUniformBuf_Type = { PyTypeObject BPyGPUUniformBuf_Type = {
PyVarObject_HEAD_INIT(NULL, 0).tp_name = "GPUUniformBuf", PyVarObject_HEAD_INIT(NULL, 0).tp_name = "GPUUniformBuf",
.tp_basicsize = sizeof(BPyGPUUniformBuf), .tp_basicsize = sizeof(BPyGPUUniformBuf),

View File

@@ -271,7 +271,7 @@ PyDoc_STRVAR(pygpu_vertbuf_attr_fill_doc,
" :param id: Either the name or the id of the attribute.\n" " :param id: Either the name or the id of the attribute.\n"
" :type id: int or str\n" " :type id: int or str\n"
" :param data: Sequence of data that should be stored in the buffer\n" " :param data: Sequence of data that should be stored in the buffer\n"
" :type data: sequence of values or tuples\n"); " :type data: sequence of floats, ints, vectors or matrices\n");
static PyObject *pygpu_vertbuf_attr_fill(BPyGPUVertBuf *self, PyObject *args, PyObject *kwds) static PyObject *pygpu_vertbuf_attr_fill(BPyGPUVertBuf *self, PyObject *args, PyObject *kwds)
{ {
PyObject *data; PyObject *data;

View File

@@ -85,7 +85,7 @@ PyDoc_STRVAR(
" :type id: str\n" " :type id: str\n"
" :param comp_type: The data type that will be used store the value in memory.\n" " :param comp_type: The data type that will be used store the value in memory.\n"
" Possible values are `I8`, `U8`, `I16`, `U16`, `I32`, `U32`, `F32` and `I10`.\n" " Possible values are `I8`, `U8`, `I16`, `U16`, `I32`, `U32`, `F32` and `I10`.\n"
" :type comp_type: `str`\n" " :type comp_type: str\n"
" :param len: How many individual values the attribute consists of\n" " :param len: How many individual values the attribute consists of\n"
" (e.g. 2 for uv coordinates).\n" " (e.g. 2 for uv coordinates).\n"
" :type len: int\n" " :type len: int\n"
@@ -94,7 +94,7 @@ PyDoc_STRVAR(
" reduced precision. E.g. you can store a float in only 1 byte but it will be\n" " reduced precision. E.g. you can store a float in only 1 byte but it will be\n"
" converted to a normal 4 byte float when used.\n" " converted to a normal 4 byte float when used.\n"
" Possible values are `FLOAT`, `INT`, `INT_TO_FLOAT_UNIT` and `INT_TO_FLOAT`.\n" " Possible values are `FLOAT`, `INT`, `INT_TO_FLOAT_UNIT` and `INT_TO_FLOAT`.\n"
" :type fetch_mode: `str`\n"); " :type fetch_mode: str\n");
static PyObject *pygpu_vertformat_attr_add(BPyGPUVertFormat *self, PyObject *args, PyObject *kwds) static PyObject *pygpu_vertformat_attr_add(BPyGPUVertFormat *self, PyObject *args, PyObject *kwds)
{ {
const char *id; const char *id;