Beispiel #1
0
void setRenderTarget(gcmContextData *context, rsxBuffer *buffer){
	gcmSurface sf;

	sf.colorFormat = GCM_TF_COLOR_X8R8G8B8;
	sf.colorTarget = GCM_TF_TARGET_0;
	sf.colorLocation[0] = GCM_LOCATION_RSX;
	sf.colorOffset[0] = buffer->offset;
	sf.colorPitch[0] = depth_pitch;

	sf.colorLocation[1] = GCM_LOCATION_RSX;
	sf.colorLocation[2] = GCM_LOCATION_RSX;
	sf.colorLocation[3] = GCM_LOCATION_RSX;
	sf.colorOffset[1] = 0;
	sf.colorOffset[2] = 0;
	sf.colorOffset[3] = 0;
	sf.colorPitch[1] = 64;
	sf.colorPitch[2] = 64;
	sf.colorPitch[3] = 64;

	sf.depthFormat = GCM_TF_ZETA_Z16;
	sf.depthLocation = GCM_LOCATION_RSX;
	sf.depthOffset = depth_offset;
	sf.depthPitch = depth_pitch;

	sf.type = GCM_TF_TYPE_LINEAR;
	sf.antiAlias 	= GCM_TF_CENTER_1;

	sf.width = buffer->width;
	sf.height = buffer->height;
	sf.x = 0;
	sf.y = 0;

	rsxSetSurface(context, &sf);
}
Beispiel #2
0
void set_render_target(u32 index)
{
    gcmSurface sf;

    sf.colorFormat      = GCM_TF_COLOR_X8R8G8B8;
    sf.colorTarget      = GCM_TF_TARGET_0;
    sf.colorLocation[0] = GCM_LOCATION_RSX;
    sf.colorOffset[0]   = color_offset[index];
    sf.colorPitch[0]    = color_pitch;

    sf.colorLocation[1] = GCM_LOCATION_RSX;
    sf.colorLocation[2] = GCM_LOCATION_RSX;
    sf.colorLocation[3] = GCM_LOCATION_RSX;
    sf.colorOffset[1]   = 0;
    sf.colorOffset[2]   = 0;
    sf.colorOffset[3]   = 0;
    sf.colorPitch[1]    = 64;
    sf.colorPitch[2]    = 64;
    sf.colorPitch[3]    = 64;

    sf.depthFormat   = GCM_TF_ZETA_Z16;
    sf.depthLocation = GCM_LOCATION_RSX;
    sf.depthOffset   = depth_offset;
    sf.depthPitch    = depth_pitch;

    sf.type      = GCM_TF_TYPE_LINEAR;
    sf.antiAlias = GCM_TF_CENTER_1;

    sf.width  = display_width;
    sf.height = display_height;
    sf.x      = 0;
    sf.y      = 0;

    rsxSetSurface(context, &sf);
}
Beispiel #3
0
/* set the current render target */
inline void
rescSetRenderTarget(videoData *vdata )
{
  gcmSurface sf;
  rescSrc src;

  sf.colorFormat = GCM_TF_COLOR_A8R8G8B8;
  sf.colorTarget = GCM_TF_TARGET_0;
  sf.colorLocation[0] = GCM_LOCATION_RSX;
  sf.colorOffset[0] = vdata->rsx_buffers[vdata->currentBuffer].color_offset;
  sf.colorPitch[0] = vdata->color_pitch;

  sf.colorLocation[1] = GCM_LOCATION_RSX;
  sf.colorLocation[2] = GCM_LOCATION_RSX;
  sf.colorLocation[3] = GCM_LOCATION_RSX;
  sf.colorOffset[1] = 0;
  sf.colorOffset[2] = 0;
  sf.colorOffset[3] = 0;
  sf.colorPitch[1] = 64;
  sf.colorPitch[2] = 64;
  sf.colorPitch[3] = 64;

  sf.depthFormat = GCM_TF_ZETA_Z16;
  sf.depthLocation = GCM_LOCATION_RSX;
  sf.depthOffset = vdata->depth_offset;
  sf.depthPitch = vdata->depth_pitch;

  sf.type = GCM_TF_TYPE_LINEAR;
  sf.antiAlias 	= GCM_TF_CENTER_1;

  sf.width = vdata->rsx_buffers[vdata->currentBuffer].width;
  sf.height = vdata->rsx_buffers[vdata->currentBuffer].height;
  sf.x = 0;
  sf.y = 0;

  rsxSetSurface ( vdata->context, &sf ) ;

  /* new */
  rsxClearBuffer ( vdata->context ) ;

  /* new */
  rsxBlend ( vdata->context ) ;

  /* new */
  rsxWaitIdle ( vdata->context ) ;

  rescGcmSurface2RescSrc ( &sf, &src ) ;
  rescSetSrc ( vdata->currentBuffer, &src ) ;
}