bool ConvertVertices(VertexLoaderParameters &parameters, u32 &readsize, u32 &writesize)
{
	if (parameters.needloaderrefresh)
	{
		UpdateLoader(parameters);
	}
	auto loader = g_main_cp_state.vertex_loaders[parameters.vtx_attr_group];
	if (!loader->EnvironmentIsSupported())
	{
		loader = loader->GetFallback();
	}
	readsize = parameters.count * loader->m_VertexSize;
	if (parameters.buf_size < readsize)
		return false;
	if (parameters.skip_draw)
	{
		return true;
	}
	// Lookup pointers for any vertex arrays.
	UpdateVertexArrayPointers();
	NativeVertexFormat *nativefmt = loader->m_native_vertex_format;
	// Flush if our vertex format is different from the currently set.
	if (s_current_vtx_fmt != nullptr && s_current_vtx_fmt != nativefmt)
	{
		VertexManagerBase::Flush();
	}
	s_current_vtx_fmt = nativefmt;
	g_current_components = loader->m_native_components;
	VertexManagerBase::PrepareForAdditionalData(parameters.primitive, parameters.count, loader->m_native_stride);
	parameters.destination = VertexManagerBase::s_pCurBufferPointer;		
	s32 finalcount = loader->RunVertices(parameters);
	writesize = loader->m_native_stride * finalcount;
	IndexGenerator::AddIndices(parameters.primitive, finalcount);
	ADDSTAT(stats.thisFrame.numPrims, finalcount);
	INCSTAT(stats.thisFrame.numPrimitiveJoins);
	return true;
}
Example #2
0
const vlc_fourcc_t *vlc_fourcc_GetRGBFallback( vlc_fourcc_t i_fourcc )
{
    return GetFallback( i_fourcc, pp_RGB_fallback, p_RGB32_fallback );
}
Example #3
0
const vlc_fourcc_t *vlc_fourcc_GetYUVFallback( vlc_fourcc_t i_fourcc )
{
    return GetFallback( i_fourcc, pp_YUV_fallback, p_list_YUV );
}