GPU: GPU_generate_pass_new now takes vertex-attrs
Needed so we can tell which custom-data layers to use from the mesh.
This commit is contained in:
parent
2ed82d2e6b
commit
dbaa6c2aa2
|
@ -1846,9 +1846,11 @@ static void gpu_nodes_prune(ListBase *nodes, GPUNodeLink *outlink)
|
|||
}
|
||||
}
|
||||
|
||||
GPUPass *GPU_generate_pass_new(ListBase *nodes, struct GPUNodeLink *frag_outlink,
|
||||
const char *vert_code, const char *geom_code,
|
||||
const char *frag_lib, const char *defines)
|
||||
GPUPass *GPU_generate_pass_new(
|
||||
ListBase *nodes, struct GPUNodeLink *frag_outlink,
|
||||
GPUVertexAttribs *attribs,
|
||||
const char *vert_code, const char *geom_code,
|
||||
const char *frag_lib, const char *defines)
|
||||
{
|
||||
GPUShader *shader;
|
||||
GPUPass *pass;
|
||||
|
@ -1858,9 +1860,7 @@ GPUPass *GPU_generate_pass_new(ListBase *nodes, struct GPUNodeLink *frag_outlink
|
|||
/* prune unused nodes */
|
||||
gpu_nodes_prune(nodes, frag_outlink);
|
||||
|
||||
/* Hacky */
|
||||
GPUVertexAttribs attribs;
|
||||
gpu_nodes_get_vertex_attributes(nodes, &attribs);
|
||||
gpu_nodes_get_vertex_attributes(nodes, attribs);
|
||||
|
||||
/* generate code and compile with opengl */
|
||||
fragmentgen = code_generate_fragment(nodes, frag_outlink->output, true);
|
||||
|
|
|
@ -167,14 +167,17 @@ struct GPUPass {
|
|||
|
||||
typedef struct GPUPass GPUPass;
|
||||
|
||||
GPUPass *GPU_generate_pass_new(ListBase *nodes, struct GPUNodeLink *frag_outlink,
|
||||
const char *vert_code, const char *geom_code,
|
||||
const char *frag_lib, const char *defines);
|
||||
GPUPass *GPU_generate_pass(ListBase *nodes, struct GPUNodeLink *outlink,
|
||||
struct GPUVertexAttribs *attribs, int *builtin,
|
||||
const GPUMatType type, const char *name,
|
||||
const bool use_opensubdiv,
|
||||
const bool use_new_shading);
|
||||
GPUPass *GPU_generate_pass_new(
|
||||
ListBase *nodes, struct GPUNodeLink *frag_outlink,
|
||||
struct GPUVertexAttribs *attribs,
|
||||
const char *vert_code, const char *geom_code,
|
||||
const char *frag_lib, const char *defines);
|
||||
GPUPass *GPU_generate_pass(
|
||||
ListBase *nodes, struct GPUNodeLink *outlink,
|
||||
struct GPUVertexAttribs *attribs, int *builtin,
|
||||
const GPUMatType type, const char *name,
|
||||
const bool use_opensubdiv,
|
||||
const bool use_new_shading);
|
||||
|
||||
struct GPUShader *GPU_pass_shader(GPUPass *pass);
|
||||
|
||||
|
|
|
@ -2132,7 +2132,8 @@ GPUMaterial *GPU_material_from_nodetree(
|
|||
/* Let Draw manager finish the construction. */
|
||||
if (mat->outlink) {
|
||||
outlink = mat->outlink;
|
||||
mat->pass = GPU_generate_pass_new(&mat->nodes, outlink, vert_code, geom_code, frag_lib, defines);
|
||||
mat->pass = GPU_generate_pass_new(
|
||||
&mat->nodes, outlink, &mat->attribs, vert_code, geom_code, frag_lib, defines);
|
||||
}
|
||||
|
||||
/* note that even if building the shader fails in some way, we still keep
|
||||
|
|
Loading…
Reference in New Issue