Ejemplo n.º 1
0
static bool xdk_renderchain_init(void *data,
      const void *_video_info,
      void *dev_data,
      const void *final_viewport_data,
      const void *info_data,
      unsigned fmt
      )
{
   d3d_video_t *d3d             = (d3d_video_t*)data;
   LPDIRECT3DDEVICE d3dr        = (LPDIRECT3DDEVICE)d3d->dev;
   global_t *global             = global_get_ptr();
   const video_info_t *video_info  = (const video_info_t*)_video_info;
   const LinkInfo *link_info    = (const LinkInfo*)info_data;
   xdk_renderchain_t *chain     = (xdk_renderchain_t*)d3d->renderchain_data;
   (void)final_viewport_data;
   (void)fmt;

   chain->dev                   = (LPDIRECT3DDEVICE)dev_data;
   //chain->video_info            = video_info;
   chain->pixel_size            = (fmt == RETRO_PIXEL_FORMAT_RGB565) ? 2 : 4;
   chain->tex_w                 = link_info->tex_w;
   chain->tex_h                 = link_info->tex_h;

   if (!renderchain_create_first_pass(d3d, video_info))
      return false;

   if (global->console.screen.viewports.custom_vp.width == 0)
      global->console.screen.viewports.custom_vp.width = global->video_data.width;

   if (global->console.screen.viewports.custom_vp.height == 0)
      global->console.screen.viewports.custom_vp.height = global->video_data.height;

   return true;
}
Ejemplo n.º 2
0
bool renderchain_init(void *data, const video_info_t *video_info,
      LPDIRECT3DDEVICE dev_,
      CGcontext cgCtx_,
      const D3DVIEWPORT *final_viewport_,
      const LinkInfo *info, PixelFormat fmt)
{
   renderchain_t *chain = (renderchain_t*)data;

   if (!chain)
      return false;

   chain->dev = dev_;
#ifdef HAVE_CG
   chain->cgCtx = cgCtx_;
#endif
   chain->video_info = video_info;
   chain->tracker = NULL;
   chain->final_viewport =  (D3DVIEWPORT*)final_viewport_;
   chain->frame_count = 0;
   chain->pixel_size = fmt == RGB565 ? 2 : 4;
   if (!renderchain_create_first_pass(chain, info, fmt))
      return false;
   renderchain_log_info(chain, info);
   if (!renderchain_compile_shaders(chain, chain->fStock, chain->vStock, ""))
      return false;

   return true;
}
Ejemplo n.º 3
0
static bool cg_d3d9_renderchain_init(void *data,
      const void *_video_info,
      void *dev_,
      const void *final_viewport_,
      const void *info_data, bool rgb32)
{
   const LinkInfo *info           = (const LinkInfo*)info_data;
   d3d_video_t *d3d               = (d3d_video_t*)data;
   cg_renderchain_t *chain        = (cg_renderchain_t*)d3d->renderchain_data;
   const video_info_t *video_info = (const video_info_t*)_video_info;
   unsigned fmt                   = (rgb32) ? RETRO_PIXEL_FORMAT_XRGB8888 : RETRO_PIXEL_FORMAT_RGB565;

   if (!chain)
      return false;

   chain->dev            = (LPDIRECT3DDEVICE)dev_;
   chain->video_info     = video_info;
   chain->tracker        = NULL;
   chain->final_viewport = (D3DVIEWPORT*)final_viewport_;
   chain->frame_count    = 0;
   chain->pixel_size     = (fmt == RETRO_PIXEL_FORMAT_RGB565) ? 2 : 4;

   if (!renderchain_create_first_pass(chain, info, fmt))
      return false;
   renderchain_log_info(chain, info);
   if (!renderchain_compile_shaders(chain, &chain->fStock, &chain->vStock, ""))
      return false;

   return true;
}
Ejemplo n.º 4
0
static bool renderchain_init(void *data, const video_info_t *info)
{
   d3d_video_t *chain = (d3d_video_t*)data;
   LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)chain->dev;

   chain->pixel_size   = info->rgb32 ? sizeof(uint32_t) : sizeof(uint16_t);

   if (!renderchain_create_first_pass(chain, info))
      return false;

   if (g_extern.console.screen.viewports.custom_vp.width == 0)
      g_extern.console.screen.viewports.custom_vp.width = chain->screen_width;

   if (g_extern.console.screen.viewports.custom_vp.height == 0)
      g_extern.console.screen.viewports.custom_vp.height = chain->screen_height;

   return true;
}
Ejemplo n.º 5
0
static bool xdk_renderchain_init(void *data,
      const void *_video_info,
      void *dev_data,
      const void *final_viewport_data,
      const void *info_data,
      bool rgb32
      )
{
   unsigned width, height;
   d3d_video_t *d3d             = (d3d_video_t*)data;
   LPDIRECT3DDEVICE d3dr        = (LPDIRECT3DDEVICE)d3d->dev;
   const video_info_t *video_info  = (const video_info_t*)_video_info;
   const LinkInfo *link_info    = (const LinkInfo*)info_data;
   xdk_renderchain_t *chain     = (xdk_renderchain_t*)d3d->renderchain_data;
   unsigned fmt                 = (rgb32) ? RETRO_PIXEL_FORMAT_XRGB8888 : RETRO_PIXEL_FORMAT_RGB565;
   struct video_viewport *custom_vp = video_viewport_get_custom();
   (void)final_viewport_data;
   
   if (!xdk_renderchain_init_shader(d3d, NULL))
      return false;

   video_driver_get_size(&width, &height);

   chain->dev                   = (LPDIRECT3DDEVICE)dev_data;
   //chain->video_info            = video_info;
   chain->pixel_size            = (fmt == RETRO_PIXEL_FORMAT_RGB565) ? 2 : 4;
   chain->tex_w                 = link_info->tex_w;
   chain->tex_h                 = link_info->tex_h;

   if (!renderchain_create_first_pass(d3d, video_info))
      return false;

   /* FIXME */
   if (custom_vp->width == 0)
      custom_vp->width = width;

   if (custom_vp->height == 0)
      custom_vp->height = height;

   return true;
}
Ejemplo n.º 6
0
static bool cg_d3d9_renderchain_init(void *data,
      const void *_video_info,
      void *dev_,
      const void *final_viewport_,
      const void *info_data, bool rgb32)
{
   const LinkInfo *info           = (const LinkInfo*)info_data;
   d3d_video_t *d3d               = (d3d_video_t*)data;
   cg_renderchain_t *chain        = (cg_renderchain_t*)d3d->renderchain_data;
   const video_info_t *video_info = (const video_info_t*)_video_info;
   unsigned fmt                   = (rgb32) ? RETRO_PIXEL_FORMAT_XRGB8888 : RETRO_PIXEL_FORMAT_RGB565;
   
   if (!chain)
      return false;
   if (!cg_d3d9_renderchain_init_shader(d3d, chain))
   {
      RARCH_ERR("Failed to initialize shader subsystem.\n");
      return false;
   }

   chain->dev            = (LPDIRECT3DDEVICE)dev_;
   chain->video_info     = video_info;
   chain->state_tracker  = NULL;
   chain->final_viewport = (D3DVIEWPORT*)final_viewport_;
   chain->frame_count    = 0;
   chain->pixel_size     = (fmt == RETRO_PIXEL_FORMAT_RGB565) ? 2 : 4;

   if (!renderchain_create_first_pass(chain, info, fmt))
      return false;
   renderchain_log_info(chain, info);
   if (!d3d9_cg_load_program(chain, &chain->fStock, &chain->vStock, NULL, false))
      return false;

   renderchain_set_shaders(chain->fStock, chain->vStock);

   return true;
}