• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ softpipe_context函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中softpipe_context函数的典型用法代码示例。如果您正苦于以下问题:C++ softpipe_context函数的具体用法?C++ softpipe_context怎么用?C++ softpipe_context使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了softpipe_context函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: softpipe_clear

/**
 * Clear the given buffers to the specified values.
 * No masking, no scissor (clear entire buffer).
 */
void
softpipe_clear(struct pipe_context *pipe, unsigned buffers,
               const union pipe_color_union *color,
               double depth, unsigned stencil)
{
   struct softpipe_context *softpipe = softpipe_context(pipe);
   uint64_t cv;
   uint i;

   if (softpipe->no_rast)
      return;

   if (!softpipe_check_render_cond(softpipe))
      return;

#if 0
   softpipe_update_derived(softpipe, PIPE_PRIM_TRIANGLES); /* not needed?? */
#endif

   if (buffers & PIPE_CLEAR_COLOR) {
      for (i = 0; i < softpipe->framebuffer.nr_cbufs; i++) {
         sp_tile_cache_clear(softpipe->cbuf_cache[i], color, 0);
      }
   }

   if (buffers & PIPE_CLEAR_DEPTHSTENCIL) {
      static const union pipe_color_union zero;
      struct pipe_surface *ps = softpipe->framebuffer.zsbuf;

      cv = util_pack64_z_stencil(ps->format, depth, stencil);
      sp_tile_cache_clear(softpipe->zsbuf_cache, &zero, cv);
   }

   softpipe->dirty_render_cache = TRUE;
}
开发者ID:ChillyWillyGuru,项目名称:RSXGL,代码行数:39,代码来源:sp_clear.c


示例2: softpipe_set_vertex_sampler_textures

void
softpipe_set_vertex_sampler_textures(struct pipe_context *pipe,
                                     unsigned num_textures,
                                     struct pipe_texture **textures)
{
   struct softpipe_context *softpipe = softpipe_context(pipe);
   uint i;

   assert(num_textures <= PIPE_MAX_VERTEX_SAMPLERS);

   /* Check for no-op */
   if (num_textures == softpipe->num_vertex_textures &&
       !memcmp(softpipe->vertex_textures, textures, num_textures * sizeof(struct pipe_texture *))) {
      return;
   }

   draw_flush(softpipe->draw);

   for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
      struct pipe_texture *tex = i < num_textures ? textures[i] : NULL;

      pipe_texture_reference(&softpipe->vertex_textures[i], tex);
      sp_tex_tile_cache_set_texture(softpipe->vertex_tex_cache[i], tex);
   }

   softpipe->num_vertex_textures = num_textures;

   softpipe->dirty |= SP_NEW_TEXTURE;
}
开发者ID:CPFDSoftware-Tony,项目名称:gmv,代码行数:29,代码来源:sp_state_sampler.c


示例3: softpipe_bind_vertex_sampler_states

void
softpipe_bind_vertex_sampler_states(struct pipe_context *pipe,
                                    unsigned num_samplers,
                                    void **samplers)
{
   struct softpipe_context *softpipe = softpipe_context(pipe);
   unsigned i;

   assert(num_samplers <= PIPE_MAX_VERTEX_SAMPLERS);

   /* Check for no-op */
   if (num_samplers == softpipe->num_vertex_samplers &&
       !memcmp(softpipe->vertex_samplers, samplers, num_samplers * sizeof(void *)))
      return;

   draw_flush(softpipe->draw);

   for (i = 0; i < num_samplers; ++i)
      softpipe->vertex_samplers[i] = samplers[i];
   for (i = num_samplers; i < PIPE_MAX_VERTEX_SAMPLERS; ++i)
      softpipe->vertex_samplers[i] = NULL;

   softpipe->num_vertex_samplers = num_samplers;

   softpipe->dirty |= SP_NEW_SAMPLER;
}
开发者ID:CPFDSoftware-Tony,项目名称:gmv,代码行数:26,代码来源:sp_state_sampler.c


示例4: softpipe_destroy

static void
softpipe_destroy( struct pipe_context *pipe )
{
   struct softpipe_context *softpipe = softpipe_context( pipe );
   uint i, sh;

#if DO_PSTIPPLE_IN_HELPER_MODULE
   if (softpipe->pstipple.sampler)
      pipe->delete_sampler_state(pipe, softpipe->pstipple.sampler);

   pipe_resource_reference(&softpipe->pstipple.texture, NULL);
   pipe_sampler_view_reference(&softpipe->pstipple.sampler_view, NULL);
#endif

   if (softpipe->draw)
      draw_destroy( softpipe->draw );

   if (softpipe->quad.shade)
      softpipe->quad.shade->destroy( softpipe->quad.shade );

   if (softpipe->quad.depth_test)
      softpipe->quad.depth_test->destroy( softpipe->quad.depth_test );

   if (softpipe->quad.blend)
      softpipe->quad.blend->destroy( softpipe->quad.blend );

   if (softpipe->quad.pstipple)
      softpipe->quad.pstipple->destroy( softpipe->quad.pstipple );

   for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
      sp_destroy_tile_cache(softpipe->cbuf_cache[i]);
      pipe_surface_reference(&softpipe->framebuffer.cbufs[i], NULL);
   }

   sp_destroy_tile_cache(softpipe->zsbuf_cache);
   pipe_surface_reference(&softpipe->framebuffer.zsbuf, NULL);

   for (sh = 0; sh < Elements(softpipe->tex_cache); sh++) {
      for (i = 0; i < Elements(softpipe->tex_cache[0]); i++) {
         sp_destroy_tex_tile_cache(softpipe->tex_cache[sh][i]);
         pipe_sampler_view_reference(&softpipe->sampler_views[sh][i], NULL);
      }
   }

   for (sh = 0; sh < Elements(softpipe->constants); sh++) {
      for (i = 0; i < Elements(softpipe->constants[0]); i++) {
         if (softpipe->constants[sh][i]) {
            pipe_resource_reference(&softpipe->constants[sh][i], NULL);
         }
      }
   }

   for (i = 0; i < softpipe->num_vertex_buffers; i++) {
      pipe_resource_reference(&softpipe->vertex_buffer[i].buffer, NULL);
   }

   tgsi_exec_machine_destroy(softpipe->fs_machine);

   FREE( softpipe );
}
开发者ID:FASTCHIP,项目名称:kernel_3.4.67_lenovo_s939_mtk6592,代码行数:60,代码来源:sp_context.c


示例5: softpipe_begin_query

static void
softpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q)
{
   struct softpipe_context *softpipe = softpipe_context( pipe );
   struct softpipe_query *sq = softpipe_query(q);

   switch (sq->type) {
   case PIPE_QUERY_OCCLUSION_COUNTER:
      sq->start = softpipe->occlusion_count;
      break;
   case PIPE_QUERY_TIMESTAMP_DISJOINT:
   case PIPE_QUERY_TIME_ELAPSED:
      sq->start = 1000*os_time_get();
      break;
   case PIPE_QUERY_SO_STATISTICS:
      sq->so.primitives_storage_needed = 0;
   case PIPE_QUERY_PRIMITIVES_EMITTED:
      sq->so.num_primitives_written = 0;
      softpipe->so_stats.num_primitives_written = 0;
      break;
   case PIPE_QUERY_PRIMITIVES_GENERATED:
      sq->num_primitives_generated = 0;
      softpipe->num_primitives_generated = 0;
      break;
   case PIPE_QUERY_TIMESTAMP:
   case PIPE_QUERY_GPU_FINISHED:
      break;
   default:
      assert(0);
      break;
   }
   softpipe->active_query_count++;
   softpipe->dirty |= SP_NEW_QUERY;
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:34,代码来源:sp_query.c


示例6: softpipe_end_query

static void
softpipe_end_query(struct pipe_context *pipe, struct pipe_query *q)
{
   struct softpipe_context *softpipe = softpipe_context( pipe );
   struct softpipe_query *sq = softpipe_query(q);

   sq->end = softpipe->occlusion_count;
}
开发者ID:toastpp,项目名称:toastpp,代码行数:8,代码来源:sp_query.c


示例7: softpipe_set_clip_state

void softpipe_set_clip_state( struct pipe_context *pipe,
			     const struct pipe_clip_state *clip )
{
   struct softpipe_context *softpipe = softpipe_context(pipe);

   /* pass the clip state to the draw module */
   draw_set_clip_state(softpipe->draw, clip);
}
开发者ID:1065672644894730302,项目名称:Chromium,代码行数:8,代码来源:sp_state_clip.c


示例8: softpipe_set_sampler_views

void
softpipe_set_sampler_views(struct pipe_context *pipe,
                           unsigned shader,
                           unsigned start,
                           unsigned num,
                           struct pipe_sampler_view **views)
{
   struct softpipe_context *softpipe = softpipe_context(pipe);
   uint i;

   assert(shader < PIPE_SHADER_TYPES);
   assert(start + num <= ARRAY_SIZE(softpipe->sampler_views[shader]));

   draw_flush(softpipe->draw);

   /* set the new sampler views */
   for (i = 0; i < num; i++) {
      struct sp_sampler_view *sp_sviewsrc;
      struct sp_sampler_view *sp_sviewdst =
         &softpipe->tgsi.sampler[shader]->sp_sview[start + i];
      struct pipe_sampler_view **pview = &softpipe->sampler_views[shader][start + i];
      pipe_sampler_view_reference(pview, views[i]);
      sp_tex_tile_cache_set_sampler_view(softpipe->tex_cache[shader][start + i],
                                         views[i]);
      /*
       * We don't really have variants, however some bits are different per shader,
       * so just copy?
       */
      sp_sviewsrc = (struct sp_sampler_view *)*pview;
      if (sp_sviewsrc) {
         memcpy(sp_sviewdst, sp_sviewsrc, sizeof(*sp_sviewsrc));
         sp_sviewdst->compute_lambda = softpipe_get_lambda_func(&sp_sviewdst->base, shader);
         sp_sviewdst->cache = softpipe->tex_cache[shader][start + i];
      }
      else {
         memset(sp_sviewdst, 0,  sizeof(*sp_sviewsrc));
      }
   }


   /* find highest non-null sampler_views[] entry */
   {
      unsigned j = MAX2(softpipe->num_sampler_views[shader], start + num);
      while (j > 0 && softpipe->sampler_views[shader][j - 1] == NULL)
         j--;
      softpipe->num_sampler_views[shader] = j;
   }

   if (shader == PIPE_SHADER_VERTEX || shader == PIPE_SHADER_GEOMETRY) {
      draw_set_sampler_views(softpipe->draw,
                             shader,
                             softpipe->sampler_views[shader],
                             softpipe->num_sampler_views[shader]);
   }

   softpipe->dirty |= SP_NEW_TEXTURE;
}
开发者ID:BNieuwenhuizen,项目名称:mesa,代码行数:57,代码来源:sp_state_sampler.c


示例9: softpipe_set_stencil_ref

void softpipe_set_stencil_ref( struct pipe_context *pipe,
                               const struct pipe_stencil_ref *stencil_ref )
{
   struct softpipe_context *softpipe = softpipe_context(pipe);

   softpipe->stencil_ref = *stencil_ref;

   softpipe->dirty |= SP_NEW_DEPTH_STENCIL_ALPHA;
}
开发者ID:CPFDSoftware-Tony,项目名称:gmv,代码行数:9,代码来源:sp_state_blend.c


示例10: softpipe_set_blend_color

void softpipe_set_blend_color( struct pipe_context *pipe,
                               const struct pipe_blend_color *blend_color )
{
    struct softpipe_context *softpipe = softpipe_context(pipe);

    softpipe->blend_color = *blend_color;

    softpipe->dirty |= SP_NEW_BLEND;
}
开发者ID:astrofimov,项目名称:vgallium,代码行数:9,代码来源:sp_state_blend.c


示例11: softpipe_bind_blend_state

void softpipe_bind_blend_state( struct pipe_context *pipe,
                                void *blend )
{
    struct softpipe_context *softpipe = softpipe_context(pipe);

    softpipe->blend = (const struct pipe_blend_state *)blend;

    softpipe->dirty |= SP_NEW_BLEND;
}
开发者ID:astrofimov,项目名称:vgallium,代码行数:9,代码来源:sp_state_blend.c


示例12: softpipe_bind_depth_stencil_state

void
softpipe_bind_depth_stencil_state(struct pipe_context *pipe,
                                  void *depth_stencil)
{
   struct softpipe_context *softpipe = softpipe_context(pipe);

   softpipe->depth_stencil = (struct pipe_depth_stencil_alpha_state *)depth_stencil;

   softpipe->dirty |= SP_NEW_DEPTH_STENCIL_ALPHA;
}
开发者ID:CPFDSoftware-Tony,项目名称:gmv,代码行数:10,代码来源:sp_state_blend.c


示例13: softpipe_render_condition

static void
softpipe_render_condition( struct pipe_context *pipe,
                           struct pipe_query *query,
                           uint mode )
{
   struct softpipe_context *softpipe = softpipe_context( pipe );

   softpipe->render_cond_query = query;
   softpipe->render_cond_mode = mode;
}
开发者ID:FASTCHIP,项目名称:kernel_3.4.67_lenovo_s939_mtk6592,代码行数:10,代码来源:sp_context.c


示例14: softpipe_set_polygon_stipple

void softpipe_set_polygon_stipple( struct pipe_context *pipe,
                                   const struct pipe_poly_stipple *stipple )
{
   struct softpipe_context *softpipe = softpipe_context(pipe);

   draw_flush(softpipe->draw);

   softpipe->poly_stipple = *stipple; /* struct copy */
   softpipe->dirty |= SP_NEW_STIPPLE;
}
开发者ID:1065672644894730302,项目名称:Chromium,代码行数:10,代码来源:sp_state_clip.c


示例15: softpipe_set_scissor_state

void softpipe_set_scissor_state( struct pipe_context *pipe,
                                 const struct pipe_scissor_state *scissor )
{
   struct softpipe_context *softpipe = softpipe_context(pipe);

   draw_flush(softpipe->draw);

   softpipe->scissor = *scissor; /* struct copy */
   softpipe->dirty |= SP_NEW_SCISSOR;
}
开发者ID:1065672644894730302,项目名称:Chromium,代码行数:10,代码来源:sp_state_clip.c


示例16: softpipe_set_framebuffer_state

/**
 * XXX this might get moved someday
 * Set the framebuffer surface info: color buffers, zbuffer, stencil buffer.
 * Here, we flush the old surfaces and update the tile cache to point to the new
 * surfaces.
 */
void
softpipe_set_framebuffer_state(struct pipe_context *pipe,
                               const struct pipe_framebuffer_state *fb)
{
   struct softpipe_context *sp = softpipe_context(pipe);
   uint i;

   draw_flush(sp->draw);

   for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
      struct pipe_surface *cb = i < fb->nr_cbufs ? fb->cbufs[i] : NULL;

      /* check if changing cbuf */
      if (sp->framebuffer.cbufs[i] != cb) {
         /* flush old */
         sp_flush_tile_cache(sp->cbuf_cache[i]);

         /* assign new */
         pipe_surface_reference(&sp->framebuffer.cbufs[i], cb);

         /* update cache */
         sp_tile_cache_set_surface(sp->cbuf_cache[i], cb);
      }
   }

   sp->framebuffer.nr_cbufs = fb->nr_cbufs;

   /* zbuf changing? */
   if (sp->framebuffer.zsbuf != fb->zsbuf) {
      /* flush old */
      sp_flush_tile_cache(sp->zsbuf_cache);

      /* assign new */
      pipe_surface_reference(&sp->framebuffer.zsbuf, fb->zsbuf);

      /* update cache */
      sp_tile_cache_set_surface(sp->zsbuf_cache, fb->zsbuf);

      /* Tell draw module how deep the Z/depth buffer is
       *
       * If no depth buffer is bound, send the utility function the
       * format for no bound depth (PIPE_FORMAT_NONE).
       */
      draw_set_zs_format(sp->draw,
                         (sp->framebuffer.zsbuf) ?
                            sp->framebuffer.zsbuf->format : PIPE_FORMAT_NONE);
   }

   sp->framebuffer.width = fb->width;
   sp->framebuffer.height = fb->height;
   sp->framebuffer.samples = fb->samples;
   sp->framebuffer.layers = fb->layers;

   sp->dirty |= SP_NEW_FRAMEBUFFER;
}
开发者ID:ChristophHaag,项目名称:mesa-mesa,代码行数:61,代码来源:sp_state_surface.c


示例17: softpipe_set_viewport_state

void softpipe_set_viewport_state( struct pipe_context *pipe,
                                  const struct pipe_viewport_state *viewport )
{
   struct softpipe_context *softpipe = softpipe_context(pipe);

   /* pass the viewport info to the draw module */
   draw_set_viewport_state(softpipe->draw, viewport);

   softpipe->viewport = *viewport; /* struct copy */
   softpipe->dirty |= SP_NEW_VIEWPORT;
}
开发者ID:1065672644894730302,项目名称:Chromium,代码行数:11,代码来源:sp_state_clip.c


示例18: softpipe_set_index_buffer

static void
softpipe_set_index_buffer(struct pipe_context *pipe,
                          const struct pipe_index_buffer *ib)
{
   struct softpipe_context *softpipe = softpipe_context(pipe);

   if (ib)
      memcpy(&softpipe->index_buffer, ib, sizeof(softpipe->index_buffer));
   else
      memset(&softpipe->index_buffer, 0, sizeof(softpipe->index_buffer));
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:11,代码来源:sp_state_vertex.c


示例19: sp_blit

static void sp_blit(struct pipe_context *pipe,
                    const struct pipe_blit_info *info)
{
   struct softpipe_context *sp = softpipe_context(pipe);

   if (info->render_condition_enable && !softpipe_check_render_cond(sp))
      return;

   if (info->src.resource->nr_samples > 1 &&
       info->dst.resource->nr_samples <= 1 &&
       !util_format_is_depth_or_stencil(info->src.resource->format) &&
       !util_format_is_pure_integer(info->src.resource->format)) {
      debug_printf("softpipe: color resolve unimplemented\n");
      return;
   }

   if (util_try_blit_via_copy_region(pipe, info)) {
      return; /* done */
   }

   if (!util_blitter_is_blit_supported(sp->blitter, info)) {
      debug_printf("softpipe: blit unsupported %s -> %s\n",
                   util_format_short_name(info->src.resource->format),
                   util_format_short_name(info->dst.resource->format));
      return;
   }

   /* XXX turn off occlusion and streamout queries */

   util_blitter_save_vertex_buffer_slot(sp->blitter, sp->vertex_buffer);
   util_blitter_save_vertex_elements(sp->blitter, sp->velems);
   util_blitter_save_vertex_shader(sp->blitter, sp->vs);
   util_blitter_save_geometry_shader(sp->blitter, sp->gs);
   util_blitter_save_so_targets(sp->blitter, sp->num_so_targets,
                     (struct pipe_stream_output_target**)sp->so_targets);
   util_blitter_save_rasterizer(sp->blitter, sp->rasterizer);
   util_blitter_save_viewport(sp->blitter, &sp->viewports[0]);
   util_blitter_save_scissor(sp->blitter, &sp->scissors[0]);
   util_blitter_save_fragment_shader(sp->blitter, sp->fs);
   util_blitter_save_blend(sp->blitter, sp->blend);
   util_blitter_save_depth_stencil_alpha(sp->blitter, sp->depth_stencil);
   util_blitter_save_stencil_ref(sp->blitter, &sp->stencil_ref);
   /*util_blitter_save_sample_mask(sp->blitter, sp->sample_mask);*/
   util_blitter_save_framebuffer(sp->blitter, &sp->framebuffer);
   util_blitter_save_fragment_sampler_states(sp->blitter,
                     sp->num_samplers[PIPE_SHADER_FRAGMENT],
                     (void**)sp->samplers[PIPE_SHADER_FRAGMENT]);
   util_blitter_save_fragment_sampler_views(sp->blitter,
                     sp->num_sampler_views[PIPE_SHADER_FRAGMENT],
                     sp->sampler_views[PIPE_SHADER_FRAGMENT]);
   util_blitter_save_render_condition(sp->blitter, sp->render_cond_query,
                                      sp->render_cond_cond, sp->render_cond_mode);
   util_blitter_blit(sp->blitter, info);
}
开发者ID:ChristophHaag,项目名称:mesa-mesa,代码行数:54,代码来源:sp_surface.c


示例20: softpipe_bind_rasterizer_state

void softpipe_bind_rasterizer_state(struct pipe_context *pipe,
                                    void *setup)
{
   struct softpipe_context *softpipe = softpipe_context(pipe);

   /* pass-through to draw module */
   draw_set_rasterizer_state(softpipe->draw, setup);

   softpipe->rasterizer = (struct pipe_rasterizer_state *)setup;

   softpipe->dirty |= SP_NEW_RASTERIZER;
}
开发者ID:aljen,项目名称:haiku-opengl,代码行数:12,代码来源:sp_state_rasterizer.c



注:本文中的softpipe_context函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ softpipe_screen函数代码示例发布时间:2022-05-30
下一篇:
C++ softirq_count函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap