Merge pull request #43332 from lawnjelly/ewok_line2d

Batching - use legacy path for antialiased polys.
This commit is contained in:
Rémi Verschelde 2020-11-05 12:29:07 +01:00 committed by GitHub
commit 7fccecf6a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2160,13 +2160,20 @@ PREAMBLE(bool)::prefill_joined_item(FillState &r_fill_state, int &r_command_star
case RasterizerCanvas::Item::Command::TYPE_POLYGON: { case RasterizerCanvas::Item::Command::TYPE_POLYGON: {
RasterizerCanvas::Item::CommandPolygon *polygon = static_cast<RasterizerCanvas::Item::CommandPolygon *>(command);
#ifdef GLES_OVER_GL
// anti aliasing not accelerated .. it is problematic because it requires a 2nd line drawn around the outside of each
// poly, which would require either a second list of indices or a second list of vertices for this step
if (polygon->antialiased) {
// not accelerated
_prefill_default_batch(r_fill_state, command_num, *p_item);
} else {
#endif
// not using software skinning? // not using software skinning?
if (!bdata.settings_use_software_skinning && get_this()->state.using_skeleton) { if (!bdata.settings_use_software_skinning && get_this()->state.using_skeleton) {
// not accelerated // not accelerated
_prefill_default_batch(r_fill_state, command_num, *p_item); _prefill_default_batch(r_fill_state, command_num, *p_item);
} else { } else {
RasterizerCanvas::Item::CommandPolygon *polygon = static_cast<RasterizerCanvas::Item::CommandPolygon *>(command);
// unoptimized - could this be done once per batch / batch texture? // unoptimized - could this be done once per batch / batch texture?
bool send_light_angles = polygon->normal_map != RID(); bool send_light_angles = polygon->normal_map != RID();
@ -2181,7 +2188,10 @@ PREAMBLE(bool)::prefill_joined_item(FillState &r_fill_state, int &r_command_star
if (buffer_full) if (buffer_full)
return true; return true;
} // using software skinning path } // if not using hardware skinning path
#ifdef GLES_OVER_GL
} // if not anti-aliased poly
#endif
} break; } break;
} }
@ -2897,18 +2907,19 @@ PREAMBLE(bool)::_detect_item_batch_break(RenderItemState &r_ris, RasterizerCanva
} }
} break; } break;
case RasterizerCanvas::Item::Command::TYPE_POLYGON: { case RasterizerCanvas::Item::Command::TYPE_POLYGON: {
//return true;
// only allow polygons to join if they aren't skeleton // only allow polygons to join if they aren't skeleton
RasterizerCanvas::Item::CommandPolygon *poly = static_cast<RasterizerCanvas::Item::CommandPolygon *>(command); RasterizerCanvas::Item::CommandPolygon *poly = static_cast<RasterizerCanvas::Item::CommandPolygon *>(command);
// return true; #ifdef GLES_OVER_GL
// anti aliasing not accelerated
if (poly->antialiased)
return true;
#endif
// light angles not yet implemented, treat as default // light angles not yet implemented, treat as default
if (poly->normal_map != RID()) if (poly->normal_map != RID())
return true; return true;
// we could possibly join polygons that are software skinned? NYI
if (!get_this()->bdata.settings_use_software_skinning && poly->bones.size()) if (!get_this()->bdata.settings_use_software_skinning && poly->bones.size())
return true; return true;