PyDoc: add gpu.shader

Also some syntax corrections.
This commit is contained in:
Campbell Barton 2018-09-15 08:00:47 +10:00
parent 3f20b3b585
commit 83d4328ce7
2 changed files with 26 additions and 21 deletions

@ -1828,6 +1828,7 @@ def write_rst_importable_modules(basepath):
"gpu.types": "GPU Types", "gpu.types": "GPU Types",
"gpu.matrix": "GPU Matrix", "gpu.matrix": "GPU Matrix",
"gpu.select": "GPU Select", "gpu.select": "GPU Select",
"gpu.shader": "GPU Shader",
"bmesh": "BMesh Module", "bmesh": "BMesh Module",
"bmesh.types": "BMesh Types", "bmesh.types": "BMesh Types",
"bmesh.utils": "BMesh Utilities", "bmesh.utils": "BMesh Utilities",

@ -257,13 +257,16 @@ PyDoc_STRVAR(bpygpu_shader_uniform_vector_float_doc,
" :type location: `int`\n" " :type location: `int`\n"
" :param buffer: buffer object with format float.\n" " :param buffer: buffer object with format float.\n"
" :type buffer: `buffer object`\n" " :type buffer: `buffer object`\n"
" :param length: size of the uniform data type:\n" " :param length:\n"
" 1: float\n" " size of the uniform data type:\n"
" 2: vec2 or float[2]\n" "\n"
" 3: vec3 or float[3]\n" " - 1: float\n"
" 4: vec4 or float[4]\n" " - 2: vec2 or float[2]\n"
" 9: mat3\n" " - 3: vec3 or float[3]\n"
" 16: mat4\n" " - 4: vec4 or float[4]\n"
" - 9: mat3\n"
" - 16: mat4\n"
"\n"
" :type length: `int`\n" " :type length: `int`\n"
" :param count: specifies the number of elements, vector or matrices that are to be modified.\n" " :param count: specifies the number of elements, vector or matrices that are to be modified.\n"
" :type count: `int`\n" " :type count: `int`\n"
@ -294,7 +297,7 @@ static PyObject *bpygpu_shader_uniform_vector_float(
PyDoc_STRVAR(bpygpu_shader_uniform_vector_int_doc, PyDoc_STRVAR(bpygpu_shader_uniform_vector_int_doc,
".. method:: uniform_vector_int(location, buffer, length, count)\n" ".. method:: uniform_vector_int(location, buffer, length, count)\n"
"\n" "\n"
" See GPUShader.uniform_vector_float(...) description.\n." " See GPUShader.uniform_vector_float(...) description.\n"
); );
static PyObject *bpygpu_shader_uniform_vector_int( static PyObject *bpygpu_shader_uniform_vector_int(
BPyGPUShader *self, PyObject *args) BPyGPUShader *self, PyObject *args)
@ -376,9 +379,7 @@ static PyObject *bpygpu_shader_attr_from_name(
} }
PyDoc_STRVAR(bpygpu_shader_program_doc, PyDoc_STRVAR(bpygpu_shader_program_doc,
".. method:: The name of the program object for use by the OpenGL API (read-only).\n" "The name of the program object for use by the OpenGL API (read-only).\n\n:type: int"
"\n"
" :rtype: `int`\n"
); );
static PyObject *bpygpu_shader_program_get(BPyGPUShader *self, void *UNUSED(closure)) static PyObject *bpygpu_shader_program_get(BPyGPUShader *self, void *UNUSED(closure))
{ {
@ -439,12 +440,15 @@ PyDoc_STRVAR(bpygpu_shader_doc,
"The GLSL #version directive is automatically included at the top of shaders, and set to 330.\n" "The GLSL #version directive is automatically included at the top of shaders, and set to 330.\n"
"\n" "\n"
"Some preprocessor directives are automatically added according to the Operating System or availability.\n" "Some preprocessor directives are automatically added according to the Operating System or availability.\n"
"These are:\n" "\n"
"These are::\n"
"\n"
" \"#define GPU_ATI\\n\"\n" " \"#define GPU_ATI\\n\"\n"
" \"#define GPU_NVIDIA\\n\"\n" " \"#define GPU_NVIDIA\\n\"\n"
" \"#define GPU_INTEL\\n\"\n" " \"#define GPU_INTEL\\n\"\n"
"\n" "\n"
"The following extensions are enabled by default if supported by the GPU:\n" "The following extensions are enabled by default if supported by the GPU::\n"
"\n"
" \"#extension GL_ARB_texture_gather: enable\\n\"\n" " \"#extension GL_ARB_texture_gather: enable\\n\"\n"
" \"#extension GL_ARB_texture_query_lod: enable\\n\"\n" " \"#extension GL_ARB_texture_query_lod: enable\\n\"\n"
"\n" "\n"