📄 slaveport.h
字号:
/**************************************************************************
* Name : slaveport.h
* Author : BCB
* Created : 23/05/2003
*
* Copyright : 2003 by Imagination Technologies Limited. All rights reserved.
* : No part of this software, either material or conceptual
* : may be copied or distributed, transmitted, transcribed,
* : stored in a retrieval system or translated into any
* : human or computer language in any form by any means,
* : electronic, mechanical, manual or other-wise, or
* : disclosed to third parties without the express written
* : permission of Imagination Technologies Limited, Unit 8, HomePark
* : Industrial Estate, King's Langley, Hertfordshire,
* : WD4 8LZ, U.K.
*
* Platform : ANSI
*
* $Date: 2004/10/26 09:08:25 $ $Revision: 1.16.1.3 $
* $Log: slaveport.h $
**************************************************************************/
#ifndef _SLAVEPORT_
#define _SLAVEPORT_
static INLINE IMG_VOID WriteToSlavePort(GLESContext *gc, IMG_VOID *pvData, IMG_UINT32 ui32Size)
{
#if defined(PDUMP) || defined(OLDPDUMP)
IMG_UINT32 ui32Count, ui32TempVal;
IMG_UINT32 *pui32Data = (IMG_UINT32 *)pvData;
#endif
IMG_UINT32 ui32AmountToWrite, ui32TotalBytes;
IMG_VOID *pvDataToWrite = pvData;
GLES_TIME_START(GLES_TIMER_TOTAL_SLAVEPORT_COPY_TIME);
ui32TotalBytes = ui32Size << 2;
while(ui32TotalBytes)
{
if(gc->sHWContext.ui32FifoSpace == 0)
{
GLES_TIME_START(GLES_TIMES_ACQUIRE_SLAVEPORT);
if(PVRSRVAcquire3DFifoSpace(gc->sHWContext.ps3DDevData->psDevInfoUM,
gc->sHWContext.psHWInfo,
&gc->sHWContext.ui32FifoSpace) != PVRSRV_OK)
{
DPF((DBG_FATAL,"Cannot acquire fifo space"));
GLES_TIME_STOP(GLES_TIMER_TOTAL_SLAVEPORT_COPY_TIME);
return;
}
GLES_TIME_STOP(GLES_TIMES_ACQUIRE_SLAVEPORT);
}
if(gc->sHWContext.ui32FifoSpace > ui32TotalBytes)
{
ui32AmountToWrite = ui32TotalBytes;
}
else
{
ui32AmountToWrite = gc->sHWContext.ui32FifoSpace;
}
PVRSRVWriteSlavePortBatch ( &gc->sHWContext.psHWInfo->sDeviceSpecific.sMBX.sTASlavePort,
pvDataToWrite,
ui32AmountToWrite);
PVRSRVRelease3DFifoSpace (gc->sHWContext.ps3DDevData->psDevInfoUM, ui32AmountToWrite);
ui32TotalBytes -= ui32AmountToWrite;
gc->sHWContext.ui32FifoSpace -= ui32AmountToWrite;
pvDataToWrite = (IMG_UINT8 *)pvDataToWrite + ui32AmountToWrite;
}
#if defined(PDUMP)
for(ui32Count=0; ui32Count < ui32Size; ui32Count++)
{
ui32TempVal = pui32Data[ui32Count];
PDUMPSP(gc->psPDContext, PDUMPTAGS_SP_MBX_DATA, ui32TempVal);
}
#endif /* defined(PDUMP) */
#if defined(OLDPDUMP)
for(ui32Count=0; ui32Count < ui32Size; ui32Count++)
{
ui32TempVal = pui32Data[ui32Count];
PDUMP_WRITESLAVEPORT(gc, ui32TempVal);
}
#endif /* defined(PDUMP) */
GLES_TIME_STOP(GLES_TIMER_TOTAL_SLAVEPORT_COPY_TIME);
GLES_INC_COUNT(GLES_TIMER_TOTAL_SLAVEPORT_COPY_COUNT, ui32Size << 2);
}
#ifndef USE_TERMINATE_WORD
static INLINE IMG_VOID WriteToSlavePortTerminate(GLESContext *gc, IMG_UINT32 ui32Data)
{
GLES_TIME_START(GLES_TIMER_TOTAL_SLAVEPORT_COPY_TIME);
while(gc->sHWContext.ui32FifoSpace == 0)
{
GLES_TIME_START(GLES_TIMES_ACQUIRE_SLAVEPORT);
if(PVRSRVAcquire3DFifoSpace(gc->sHWContext.ps3DDevData->psDevInfoUM,
gc->sHWContext.psHWInfo,
&gc->sHWContext.ui32FifoSpace) != PVRSRV_OK)
{
DPF((DBG_FATAL,"Cannot acquire fifo space"));
GLES_TIME_STOP(GLES_TIMER_TOTAL_SLAVEPORT_COPY_TIME);
return;
}
GLES_TIME_STOP(GLES_TIMES_ACQUIRE_SLAVEPORT);
}
PDUMPSP(gc->psPDContext, PDUMPTAGS_SP_MBX_TERM, ui32Data);
#if defined(OLDPDUMP)
PDUMP_WRITETERMINATEPORT(gc, ui32Data);
#endif /* defined(PDUMP) */
PVRSRVWriteSlavePort(&gc->sHWContext.psHWInfo->sDeviceSpecific.sMBX.sTAControlSlavePort,
ui32Data);
PVRSRVRelease3DFifoSpace (gc->sHWContext.ps3DDevData->psDevInfoUM, 4);
gc->sHWContext.ui32FifoSpace -= 4;
GLES_TIME_STOP(GLES_TIMER_TOTAL_SLAVEPORT_COPY_TIME);
GLES_INC_COUNT(GLES_TIMER_TOTAL_SLAVEPORT_COPY_COUNT, 4);
}
#endif
#if (defined (SUPPORT_VGP) || defined(SUPPORT_VGP_LITE)) && !defined(PASSTHROUGH_BUILD)
IMG_VOID OutputVertex(GLESContext *gc, IMG_VOID *pvInput, IMG_UINT32 ui32Count);
#else
#if !defined(USE_FIXED_POINT_VERTICES)
extern IMG_VOID (*apfnOutputVertexProcs[8])(GLESContext *gc, GLESvertex *psVertex, IMG_UINT32 ui32Count);
#endif
#endif
IMG_VOID OutputVerticesSpecialObject(GLESContext *gc, IMG_FLOAT *pfVert,
IMG_UINT32 ui32NumVerts, IMG_UINT32 ui32VertexSize);
IMG_VOID StartTriangleList(GLESContext *gc);
IMG_VOID StartTriangleStrip(GLESContext *gc);
IMG_VOID StartTriangleFan(GLESContext *gc);
IMG_VOID StartLineStrip(GLESContext *gc);
IMG_VOID StartPointList(GLESContext *gc);
IMG_VOID EndPrimitiveBlock(GLESContext *gc);
IMG_VOID EndPrimitive(GLESContext *gc);
IMG_VOID EmitState(GLESContext *gc, IMG_UINT32 *pui32State, IMG_UINT32 ui32NumWords);
#endif /* _SLAVEPORT_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -