mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Fix crash in shader generator when mixing texgen stages and non-texgen stages
This commit is contained in:
parent
d807610d32
commit
4aef327d79
@ -591,12 +591,10 @@ synthesize_shader(const RenderState *rs) {
|
|||||||
const TextureAttrib *texture = DCAST(TextureAttrib, rs->get_attrib_def(TextureAttrib::get_class_slot()));
|
const TextureAttrib *texture = DCAST(TextureAttrib, rs->get_attrib_def(TextureAttrib::get_class_slot()));
|
||||||
const TexGenAttrib *tex_gen = DCAST(TexGenAttrib, rs->get_attrib_def(TexGenAttrib::get_class_slot()));
|
const TexGenAttrib *tex_gen = DCAST(TexGenAttrib, rs->get_attrib_def(TexGenAttrib::get_class_slot()));
|
||||||
for (int i=0; i<_num_textures; i++) {
|
for (int i=0; i<_num_textures; i++) {
|
||||||
if (!tex_gen->has_stage(texture->get_on_stage(i))) {
|
texcoord_vreg.push_back(alloc_vreg());
|
||||||
texcoord_vreg.push_back(alloc_vreg());
|
texcoord_freg.push_back(alloc_freg());
|
||||||
texcoord_freg.push_back(alloc_freg());
|
text << "\t in float4 vtx_texcoord" << i << " : " << texcoord_vreg[i] << ",\n";
|
||||||
text << "\t in float4 vtx_texcoord" << i << " : " << texcoord_vreg[i] << ",\n";
|
text << "\t out float4 l_texcoord" << i << " : " << texcoord_freg[i] << ",\n";
|
||||||
text << "\t out float4 l_texcoord" << i << " : " << texcoord_freg[i] << ",\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (_vertex_colors) {
|
if (_vertex_colors) {
|
||||||
text << "\t in float4 vtx_color : COLOR,\n";
|
text << "\t in float4 vtx_color : COLOR,\n";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user