diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-09 01:52:45 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-13 15:20:23 +0300 |
commit | 854c999d827cfb78938c3b4605707b891092d001 (patch) | |
tree | 6d066bbaa52689ddb6c5b4bcd692ab3e4da03dcb /source/blender/python | |
parent | 186abf7d3bab9ed8b905c6914de02427bb2547cf (diff) |
GPUShader: Change shader state tracking to be part of the GPUContext
This remove the use of batch->program and replace it with batch->shader.
This will allow GL abstraction latter.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/gpu/gpu_py_batch.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/python/gpu/gpu_py_batch.c b/source/blender/python/gpu/gpu_py_batch.c index 01bccc57c7a..bb7028c11ab 100644 --- a/source/blender/python/gpu/gpu_py_batch.c +++ b/source/blender/python/gpu/gpu_py_batch.c @@ -50,7 +50,7 @@ static bool bpygpu_batch_is_program_or_error(BPyGPUBatch *self) { - if (!glIsProgram(self->batch->program)) { + if (!self->batch->shader) { PyErr_SetString(PyExc_RuntimeError, "batch does not have any program assigned to it"); return false; } @@ -227,7 +227,7 @@ static PyObject *bpygpu_Batch_draw(BPyGPUBatch *self, PyObject *args) return NULL; } } - else if (self->batch->program != GPU_shader_get_program(py_program->shader)) { + else if (self->batch->shader != py_program->shader) { GPU_batch_set_shader(self->batch, py_program->shader); } @@ -240,7 +240,7 @@ static PyObject *bpygpu_Batch_program_use_begin(BPyGPUBatch *self) if (!bpygpu_batch_is_program_or_error(self)) { return NULL; } - GPU_batch_program_use_begin(self->batch); + GPU_shader_bind(self->batch->shader); Py_RETURN_NONE; } @@ -249,7 +249,7 @@ static PyObject *bpygpu_Batch_program_use_end(BPyGPUBatch *self) if (!bpygpu_batch_is_program_or_error(self)) { return NULL; } - GPU_batch_program_use_end(self->batch); + GPU_shader_unbind(); Py_RETURN_NONE; } |