Cleanup: remove legacy GPU pass binding code.
This commit is contained in:
parent
39142103d9
commit
14db989e73
|
@ -1194,77 +1194,6 @@ void GPU_nodes_extract_dynamic_inputs(GPUShader *shader, ListBase *inputs, ListB
|
|||
GPU_shader_unbind();
|
||||
}
|
||||
|
||||
void GPU_pass_bind(GPUPass *pass, ListBase *inputs, double time, int mipmap)
|
||||
{
|
||||
GPUInput *input;
|
||||
GPUShader *shader = pass->shader;
|
||||
|
||||
if (!shader)
|
||||
return;
|
||||
|
||||
GPU_shader_bind(shader);
|
||||
|
||||
/* create the textures */
|
||||
for (input = inputs->first; input; input = input->next) {
|
||||
if (input->ima)
|
||||
input->tex = GPU_texture_from_blender(input->ima, input->iuser, input->textarget, input->image_isdata, time, mipmap);
|
||||
else if (input->prv)
|
||||
input->tex = GPU_texture_from_preview(input->prv, mipmap);
|
||||
}
|
||||
|
||||
/* bind the textures, in second loop so texture binding during
|
||||
* create doesn't overwrite already bound textures */
|
||||
for (input = inputs->first; input; input = input->next) {
|
||||
if (input->tex && input->bindtex) {
|
||||
GPU_texture_bind(input->tex, input->texid);
|
||||
GPU_shader_uniform_texture(shader, input->shaderloc, input->tex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GPU_pass_update_uniforms(GPUPass *pass, ListBase *inputs)
|
||||
{
|
||||
GPUInput *input;
|
||||
GPUShader *shader = pass->shader;
|
||||
|
||||
if (!shader)
|
||||
return;
|
||||
|
||||
/* pass dynamic inputs to opengl, others were removed */
|
||||
for (input = inputs->first; input; input = input->next) {
|
||||
if (!(input->ima || input->tex || input->prv)) {
|
||||
if (input->dynamictype == GPU_DYNAMIC_MAT_HARD) {
|
||||
// The hardness is actually a short pointer, so we convert it here
|
||||
float val = (float)(*(short *)input->dynamicvec);
|
||||
GPU_shader_uniform_vector(shader, input->shaderloc, 1, 1, &val);
|
||||
}
|
||||
else {
|
||||
GPU_shader_uniform_vector(shader, input->shaderloc, input->type, 1,
|
||||
input->dynamicvec);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GPU_pass_unbind(GPUPass *pass, ListBase *inputs)
|
||||
{
|
||||
GPUInput *input;
|
||||
GPUShader *shader = pass->shader;
|
||||
|
||||
if (!shader)
|
||||
return;
|
||||
|
||||
for (input = inputs->first; input; input = input->next) {
|
||||
if (input->tex && input->bindtex)
|
||||
GPU_texture_unbind(input->tex);
|
||||
|
||||
if (input->ima || input->prv)
|
||||
input->tex = NULL;
|
||||
}
|
||||
|
||||
GPU_shader_unbind();
|
||||
}
|
||||
|
||||
/* Node Link Functions */
|
||||
|
||||
static GPUNodeLink *GPU_node_link_create(void)
|
||||
|
|
|
@ -184,10 +184,6 @@ void GPU_nodes_extract_dynamic_inputs(struct GPUShader *shader, ListBase *inputs
|
|||
void GPU_nodes_get_vertex_attributes(ListBase *nodes, struct GPUVertexAttribs *attribs);
|
||||
void GPU_nodes_prune(ListBase *nodes, struct GPUNodeLink *outlink);
|
||||
|
||||
void GPU_pass_bind(GPUPass *pass, ListBase *inputs, double time, int mipmap);
|
||||
void GPU_pass_update_uniforms(GPUPass *pass, ListBase *inputs);
|
||||
void GPU_pass_unbind(GPUPass *pass, ListBase *inputs);
|
||||
|
||||
void GPU_pass_compile(GPUPass *pass);
|
||||
void GPU_pass_release(GPUPass *pass);
|
||||
void GPU_pass_free_nodes(ListBase *nodes);
|
||||
|
|
Loading…
Reference in New Issue