Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-09-15 01:00:47 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-09-15 03:35:03 +0300
commit83d4328ce75c1ef8eb62fa3ed915ffd068366dfe (patch)
tree1429accbe1a765fe25def7eeec09939ebb363c45
parent3f20b3b58573e4b73047218074e289aabdc8b96c (diff)
PyDoc: add gpu.shader
Also some syntax corrections.
-rw-r--r--doc/python_api/sphinx_doc_gen.py1
-rw-r--r--source/blender/python/gpu/gpu_py_shader.c46
2 files changed, 26 insertions, 21 deletions
diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py
index 0a2fba4d8aa..278c833216f 100644
--- a/doc/python_api/sphinx_doc_gen.py
+++ b/doc/python_api/sphinx_doc_gen.py
@@ -1828,6 +1828,7 @@ def write_rst_importable_modules(basepath):
"gpu.types": "GPU Types",
"gpu.matrix": "GPU Matrix",
"gpu.select": "GPU Select",
+ "gpu.shader": "GPU Shader",
"bmesh": "BMesh Module",
"bmesh.types": "BMesh Types",
"bmesh.utils": "BMesh Utilities",
diff --git a/source/blender/python/gpu/gpu_py_shader.c b/source/blender/python/gpu/gpu_py_shader.c
index 561924c42ad..9eef178b8f0 100644
--- a/source/blender/python/gpu/gpu_py_shader.c
+++ b/source/blender/python/gpu/gpu_py_shader.c
@@ -254,16 +254,19 @@ PyDoc_STRVAR(bpygpu_shader_uniform_vector_float_doc,
" Set the buffer to fill the uniform.\n"
"\n"
" :param location: location of the uniform variable to be modified.\n"
-" :type location: `int`\n"
-" :param buffer: buffer object with format float.\n"
-" :type buffer: `buffer object`\n"
-" :param length: size of the uniform data type:\n"
-" 1: float\n"
-" 2: vec2 or float[2]\n"
-" 3: vec3 or float[3]\n"
-" 4: vec4 or float[4]\n"
-" 9: mat3\n"
-" 16: mat4\n"
+" :type location: `int`\n"
+" :param buffer: buffer object with format float.\n"
+" :type buffer: `buffer object`\n"
+" :param length:\n"
+" size of the uniform data type:\n"
+"\n"
+" - 1: float\n"
+" - 2: vec2 or float[2]\n"
+" - 3: vec3 or float[3]\n"
+" - 4: vec4 or float[4]\n"
+" - 9: mat3\n"
+" - 16: mat4\n"
+"\n"
" :type length: `int`\n"
" :param count: specifies the number of elements, vector or matrices that are to be modified.\n"
" :type count: `int`\n"
@@ -294,7 +297,7 @@ static PyObject *bpygpu_shader_uniform_vector_float(
PyDoc_STRVAR(bpygpu_shader_uniform_vector_int_doc,
".. method:: uniform_vector_int(location, buffer, length, count)\n"
"\n"
-" See GPUShader.uniform_vector_float(...) description.\n."
+" See GPUShader.uniform_vector_float(...) description.\n"
);
static PyObject *bpygpu_shader_uniform_vector_int(
BPyGPUShader *self, PyObject *args)
@@ -376,9 +379,7 @@ static PyObject *bpygpu_shader_attr_from_name(
}
PyDoc_STRVAR(bpygpu_shader_program_doc,
-".. method:: The name of the program object for use by the OpenGL API (read-only).\n"
-"\n"
-" :rtype: `int`\n"
+"The name of the program object for use by the OpenGL API (read-only).\n\n:type: int"
);
static PyObject *bpygpu_shader_program_get(BPyGPUShader *self, void *UNUSED(closure))
{
@@ -439,14 +440,17 @@ PyDoc_STRVAR(bpygpu_shader_doc,
"The GLSL #version directive is automatically included at the top of shaders, and set to 330.\n"
"\n"
"Some preprocessor directives are automatically added according to the Operating System or availability.\n"
-"These are:\n"
-" \"#define GPU_ATI\\n\"\n"
-" \"#define GPU_NVIDIA\\n\"\n"
-" \"#define GPU_INTEL\\n\"\n"
"\n"
-"The following extensions are enabled by default if supported by the GPU:\n"
-" \"#extension GL_ARB_texture_gather: enable\\n\"\n"
-" \"#extension GL_ARB_texture_query_lod: enable\\n\"\n"
+"These are::\n"
+"\n"
+" \"#define GPU_ATI\\n\"\n"
+" \"#define GPU_NVIDIA\\n\"\n"
+" \"#define GPU_INTEL\\n\"\n"
+"\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_query_lod: enable\\n\"\n"
"\n"
"To debug shaders, use the --debug-gpu-shaders command line option"
" to see full GLSL shader compilation and linking errors.\n"