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

C++ draw_do_flush函数代码示例

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

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



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

示例1: draw_set_clip_state

/**
 * Set the draw module's clipping state.
 */
void draw_set_clip_state( struct draw_context *draw,
                          const struct pipe_clip_state *clip )
{
   draw_do_flush(draw, DRAW_FLUSH_PARAMETER_CHANGE);

   memcpy(&draw->plane[6], clip->ucp, sizeof(clip->ucp));
}
开发者ID:Forzaferrarileo,项目名称:mesa,代码行数:10,代码来源:draw_context.c


示例2: draw_set_mapped_constant_buffer

void
draw_set_mapped_constant_buffer(struct draw_context *draw,
                                unsigned shader_type,
                                unsigned slot,
                                const void *buffer,
                                unsigned size )
{
   debug_assert(shader_type == PIPE_SHADER_VERTEX ||
                shader_type == PIPE_SHADER_GEOMETRY);
   debug_assert(slot < PIPE_MAX_CONSTANT_BUFFERS);

   draw_do_flush(draw, DRAW_FLUSH_PARAMETER_CHANGE);

   switch (shader_type) {
   case PIPE_SHADER_VERTEX:
      draw->pt.user.vs_constants[slot] = buffer;
      draw->pt.user.vs_constants_size[slot] = size;
      break;
   case PIPE_SHADER_GEOMETRY:
      draw->pt.user.gs_constants[slot] = buffer;
      draw->pt.user.gs_constants_size[slot] = size;
      break;
   default:
      assert(0 && "invalid shader type in draw_set_mapped_constant_buffer");
   }
}
开发者ID:Forzaferrarileo,项目名称:mesa,代码行数:26,代码来源:draw_context.c


示例3: draw_pt_so_emit_prepare

void draw_pt_so_emit_prepare(struct pt_so_emit *emit)
{
   struct draw_context *draw = emit->draw;

   emit->has_so = (draw->vs.vertex_shader->state.stream_output.num_outputs > 0);

   /* if we have a state with outputs make sure we have
    * buffers to output to */
   if (emit->has_so) {
      boolean has_valid_buffer = FALSE;
      unsigned i;
      for (i = 0; i < draw->so.num_targets; ++i) {
         if (draw->so.targets[i]) {
            has_valid_buffer = TRUE;
            break;
         }
      }
      emit->has_so = has_valid_buffer;
   }

   if (!emit->has_so)
      return;

   /* XXX: need to flush to get prim_vbuf.c to release its allocation??
    */
   draw_do_flush( draw, DRAW_FLUSH_BACKEND );
}
开发者ID:FASTCHIP,项目名称:kernel_3.4.67_lenovo_s939_mtk6592,代码行数:27,代码来源:draw_pt_so_emit.c


示例4: draw_set_samplers

void
draw_set_samplers(struct draw_context *draw,
                  unsigned shader_stage,
                  struct pipe_sampler_state **samplers,
                  unsigned num)
{
   unsigned i;

   debug_assert(shader_stage < PIPE_SHADER_TYPES);
   debug_assert(num <= PIPE_MAX_SAMPLERS);

   draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );

   for (i = 0; i < num; ++i)
      draw->samplers[shader_stage][i] = samplers[i];
   for (i = num; i < PIPE_MAX_SAMPLERS; ++i)
      draw->samplers[shader_stage][i] = NULL;

   draw->num_samplers[shader_stage] = num;

#ifdef HAVE_LLVM
   if (draw->llvm && shader_stage == PIPE_SHADER_VERTEX)
      draw_llvm_set_sampler_state(draw);
#endif
}
开发者ID:Forzaferrarileo,项目名称:mesa,代码行数:25,代码来源:draw_context.c


示例5: fse_run_linear

static void
fse_run_linear(struct draw_pt_middle_end *middle,
               unsigned start,
               unsigned count,
               unsigned prim_flags)
{
   struct fetch_shade_emit *fse = (struct fetch_shade_emit *)middle;
   struct draw_context *draw = fse->draw;
   char *hw_verts;

   /* XXX: need to flush to get prim_vbuf.c to release its allocation??
    */
   draw_do_flush( draw, DRAW_FLUSH_BACKEND );

   if (!draw->render->allocate_vertices( draw->render,
                                         (ushort)fse->key.output_stride,
                                         (ushort)count ))
      goto fail;

   hw_verts = draw->render->map_vertices( draw->render );
   if (!hw_verts)
      goto fail;

   /* Single routine to fetch vertices, run shader and emit HW verts.
    * Clipping is done elsewhere -- either by the API or on hardware,
    * or for some other reason not required...
    */
   fse->active->run_linear( fse->active,
                            start, count,
                            hw_verts );

   if (0) {
      unsigned i;
      for (i = 0; i < count; i++) {
         debug_printf("\n\n%s vertex %d: (stride %d, offset %d)\n", __FUNCTION__, i,
                      fse->key.output_stride,
                      fse->key.output_stride * i);

         draw_dump_emitted_vertex( fse->vinfo,
                                   (const uint8_t *)hw_verts + fse->key.output_stride * i );
      }
   }

   draw->render->unmap_vertices( draw->render, 0, (ushort)(count - 1) );

   /* Draw arrays path to avoid re-emitting index list again and
    * again.
    */
   draw->render->draw_arrays( draw->render,
                              0,
                              count );

   draw->render->release_vertices( draw->render );

   return;

fail:
   debug_warn_once("allocate or map of vertex buffer failed (out of memory?)");
   return;
}
开发者ID:Kariddi,项目名称:mesa-optimized-tgsi-emit,代码行数:60,代码来源:draw_pt_fetch_shade_emit.c


示例6: draw_set_viewport_states

/**
 * Set the draw module's viewport state.
 */
void draw_set_viewport_states( struct draw_context *draw,
                               unsigned start_slot,
                               unsigned num_viewports,
                               const struct pipe_viewport_state *vps )
{
   const struct pipe_viewport_state *viewport = vps;
   draw_do_flush(draw, DRAW_FLUSH_PARAMETER_CHANGE);

   debug_assert(start_slot < PIPE_MAX_VIEWPORTS);
   debug_assert((start_slot + num_viewports) <= PIPE_MAX_VIEWPORTS);

   memcpy(draw->viewports + start_slot, vps,
          sizeof(struct pipe_viewport_state) * num_viewports);

   draw->identity_viewport = (num_viewports == 1) &&
      (viewport->scale[0] == 1.0f &&
       viewport->scale[1] == 1.0f &&
       viewport->scale[2] == 1.0f &&
       viewport->scale[3] == 1.0f &&
       viewport->translate[0] == 0.0f &&
       viewport->translate[1] == 0.0f &&
       viewport->translate[2] == 0.0f &&
       viewport->translate[3] == 0.0f);

   draw->driver.bypass_clip_xy = vps[0].scale[3] == 0.0f;
   draw->clip_xy = !draw->driver.bypass_clip_xy;
   draw->identity_viewport =
      draw->identity_viewport || vps[0].scale[3] == 0.0f;
}
开发者ID:Thermionix,项目名称:Mesa-3D,代码行数:32,代码来源:draw_context.c


示例7: draw_set_rasterize_stage

/** 
 * Plug in the primitive rendering/rasterization stage (which is the last
 * stage in the drawing pipeline).
 * This is provided by the device driver.
 */
void draw_set_rasterize_stage( struct draw_context *draw,
                               struct draw_stage *stage )
{
   draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );

   draw->pipeline.rasterize = stage;
}
开发者ID:CPFDSoftware-Tony,项目名称:gmv,代码行数:12,代码来源:draw_context.c


示例8: draw_pt_so_emit_prepare

void draw_pt_so_emit_prepare(struct pt_so_emit *emit, boolean use_pre_clip_pos)
{
   struct draw_context *draw = emit->draw;

   emit->use_pre_clip_pos = use_pre_clip_pos;
   emit->has_so = draw_has_so(draw);
   if (use_pre_clip_pos)
      emit->pos_idx = draw_current_shader_position_output(draw);

   /* if we have a state with outputs make sure we have
    * buffers to output to */
   if (emit->has_so) {
      boolean has_valid_buffer = FALSE;
      unsigned i;
      for (i = 0; i < draw->so.num_targets; ++i) {
         if (draw->so.targets[i]) {
            has_valid_buffer = TRUE;
            break;
         }
      }
      emit->has_so = has_valid_buffer;
   }

   if (!emit->has_so)
      return;

   /* XXX: need to flush to get prim_vbuf.c to release its allocation??
    */
   draw_do_flush( draw, DRAW_FLUSH_BACKEND );
}
开发者ID:DirectFB,项目名称:mesa,代码行数:30,代码来源:draw_pt_so_emit.c


示例9: fetch_emit_run

static void fetch_emit_run( struct draw_pt_middle_end *middle,
                            const unsigned *fetch_elts,
                            unsigned fetch_count,
                            const ushort *draw_elts,
                            unsigned draw_count,
                            unsigned prim_flags )
{
   struct fetch_emit_middle_end *feme = (struct fetch_emit_middle_end *)middle;
   struct draw_context *draw = feme->draw;
   void *hw_verts;
   
   /* XXX: need to flush to get prim_vbuf.c to release its allocation?? 
    */
   draw_do_flush( draw, DRAW_FLUSH_BACKEND );

   draw->render->allocate_vertices( draw->render,
                                    (ushort)feme->translate->key.output_stride,
                                    (ushort)fetch_count );

   hw_verts = draw->render->map_vertices( draw->render );
   if (!hw_verts) {
      assert(0);
      return;
   }
         
					
   /* Single routine to fetch vertices and emit HW verts.
    */
   feme->translate->run_elts( feme->translate, 
			      fetch_elts,
			      fetch_count,
                              draw->instance_id,
			      hw_verts );

   if (0) {
      unsigned i;
      for (i = 0; i < fetch_count; i++) {
         debug_printf("\n\nvertex %d:\n", i);
         draw_dump_emitted_vertex( feme->vinfo, 
                                   (const uint8_t *)hw_verts + feme->vinfo->size * 4 * i );
      }
   }

   draw->render->unmap_vertices( draw->render, 
                                 0, 
                                 (ushort)(fetch_count - 1) );

   /* XXX: Draw arrays path to avoid re-emitting index list again and
    * again.
    */
   draw->render->draw_elements( draw->render, 
                                draw_elts, 
                                draw_count );

   /* Done -- that was easy, wasn't it: 
    */
   draw->render->release_vertices( draw->render );

}
开发者ID:nikai3d,项目名称:mesa,代码行数:59,代码来源:draw_pt_fetch_emit.c


示例10: draw_bind_fragment_shader

void
draw_bind_fragment_shader(struct draw_context *draw,
                          struct draw_fragment_shader *dfs)
{
   draw_do_flush(draw, DRAW_FLUSH_STATE_CHANGE);

   draw->fs.fragment_shader = dfs;
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:8,代码来源:draw_fs.c


示例11: draw_set_driver_clipping

void draw_set_driver_clipping( struct draw_context *draw,
                               boolean bypass_clipping )
{
   draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );

   draw->driver.bypass_clipping = bypass_clipping;
   draw->bypass_clipping = draw->driver.bypass_clipping;
}
开发者ID:CPFDSoftware-Tony,项目名称:gmv,代码行数:8,代码来源:draw_context.c


示例12: fse_run

static void
fse_run(struct draw_pt_middle_end *middle,
        const unsigned *fetch_elts,
        unsigned fetch_count,
        const ushort *draw_elts,
        unsigned draw_count,
        unsigned prim_flags )
{
   struct fetch_shade_emit *fse = (struct fetch_shade_emit *)middle;
   struct draw_context *draw = fse->draw;
   void *hw_verts;
   
   /* XXX: need to flush to get prim_vbuf.c to release its allocation?? 
    */
   draw_do_flush( draw, DRAW_FLUSH_BACKEND );

   if (!draw->render->allocate_vertices( draw->render,
                                         (ushort)fse->key.output_stride,
                                         (ushort)fetch_count ))
      goto fail;

   hw_verts = draw->render->map_vertices( draw->render ); 
   if (!hw_verts) 
      goto fail;
         
					
   /* Single routine to fetch vertices, run shader and emit HW verts.
    */
   fse->active->run_elts( fse->active, 
                          fetch_elts,
                          fetch_count,
                          hw_verts );


   if (0) {
      unsigned i;
      for (i = 0; i < fetch_count; i++) {
         debug_printf("\n\n%s vertex %d:\n", __FUNCTION__, i);
         draw_dump_emitted_vertex( fse->vinfo, 
                                   (const uint8_t *)hw_verts + 
                                   fse->key.output_stride * i );
      }
   }

   draw->render->unmap_vertices( draw->render, 0, (ushort)(fetch_count - 1) );
   
   draw->render->draw_elements( draw->render, 
                                draw_elts, 
                                draw_count );


   draw->render->release_vertices( draw->render );
   return;

fail:
   assert(0);
   return;
}
开发者ID:1065672644894730302,项目名称:Chromium,代码行数:58,代码来源:draw_pt_fetch_shade_emit.c


示例13: draw_set_clip_state

/**
 * Set the draw module's clipping state.
 */
void draw_set_clip_state( struct draw_context *draw,
                          const struct pipe_clip_state *clip )
{
   draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );

   assert(clip->nr <= PIPE_MAX_CLIP_PLANES);
   memcpy(&draw->plane[6], clip->ucp, clip->nr * sizeof(clip->ucp[0]));
   draw->nr_planes = 6 + clip->nr;
}
开发者ID:CPFDSoftware-Tony,项目名称:gmv,代码行数:12,代码来源:draw_context.c


示例14: fetch_emit_run_linear

static void fetch_emit_run_linear( struct draw_pt_middle_end *middle,
                                   unsigned start,
                                   unsigned count )
{
   struct fetch_emit_middle_end *feme = (struct fetch_emit_middle_end *)middle;
   struct draw_context *draw = feme->draw;
   void *hw_verts;

   /* XXX: need to flush to get prim_vbuf.c to release its allocation??
    */
   draw_do_flush( draw, DRAW_FLUSH_BACKEND );

   if (count >= UNDEFINED_VERTEX_ID) 
      goto fail;

   if (!draw->render->allocate_vertices( draw->render,
                                         (ushort)feme->translate->key.output_stride,
                                         (ushort)count )) 
      goto fail;

   hw_verts = draw->render->map_vertices( draw->render );
   if (!hw_verts) 
      goto fail;

   /* Single routine to fetch vertices and emit HW verts.
    */
   feme->translate->run( feme->translate,
                         start,
                         count,
                         hw_verts );

   if (0) {
      unsigned i;
      for (i = 0; i < count; i++) {
         debug_printf("\n\nvertex %d:\n", i);
         draw_dump_emitted_vertex( feme->vinfo,
                                   (const uint8_t *)hw_verts + feme->vinfo->size * 4 * i );
      }
   }

   draw->render->unmap_vertices( draw->render, 0, count - 1 );

   /* XXX: Draw arrays path to avoid re-emitting index list again and
    * again.
    */
   draw->render->draw_arrays( draw->render, 0, count );

   /* Done -- that was easy, wasn't it:
    */
   draw->render->release_vertices( draw->render );
   return;

fail:
   assert(0);
   return;
}
开发者ID:MttDs,项目名称:new-rexeno-tindpe,代码行数:56,代码来源:draw_pt_fetch_emit.c


示例15: draw_set_rasterizer_state

/**
 * Register new primitive rasterization/rendering state.
 * This causes the drawing pipeline to be rebuilt.
 */
void draw_set_rasterizer_state( struct draw_context *draw,
                                const struct pipe_rasterizer_state *raster )
{
   draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );

   draw->rasterizer = raster;
   draw->bypass_clipping =
      ((draw->rasterizer && draw->rasterizer->bypass_clipping) ||
       draw->driver.bypass_clipping);
}
开发者ID:astrofimov,项目名称:vgallium,代码行数:14,代码来源:draw_context.c


示例16: draw_set_driver_clipping

/* With a little more work, llvmpipe will be able to turn this off and
 * do its own x/y clipping.  
 *
 * Some hardware can turn off clipping altogether - in particular any
 * hardware with a TNL unit can do its own clipping, even if it is
 * relying on the draw module for some other reason.
 */
void draw_set_driver_clipping( struct draw_context *draw,
                               boolean bypass_clip_xy,
                               boolean bypass_clip_z )
{
   draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );

   draw->driver.bypass_clip_xy = bypass_clip_xy;
   draw->driver.bypass_clip_z = bypass_clip_z;
   update_clip_flags(draw);
}
开发者ID:nikai3d,项目名称:mesa,代码行数:17,代码来源:draw_context.c


示例17: draw_set_rasterizer_state

/**
 * Register new primitive rasterization/rendering state.
 * This causes the drawing pipeline to be rebuilt.
 */
void draw_set_rasterizer_state( struct draw_context *draw,
                                const struct pipe_rasterizer_state *raster,
                                void *rast_handle )
{
   if (!draw->suspend_flushing) {
      draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );

      draw->rasterizer = raster;
      draw->rast_handle = rast_handle;

  }
}
开发者ID:nikai3d,项目名称:mesa,代码行数:16,代码来源:draw_context.c


示例18: draw_arrays

/**
 * Draw vertex arrays
 * This is the main entrypoint into the drawing module.
 * \param prim  one of PIPE_PRIM_x
 * \param start  index of first vertex to draw
 * \param count  number of vertices to draw
 */
void
draw_arrays(struct draw_context *draw, unsigned prim,
            unsigned start, unsigned count)
{
   unsigned reduced_prim = draw_pt_reduced_prim(prim);
   if (reduced_prim != draw->reduced_prim) {
      draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
      draw->reduced_prim = reduced_prim;
   }

   /* drawing done here: */
   draw_pt_arrays(draw, prim, start, count);
}
开发者ID:astrofimov,项目名称:vgallium,代码行数:20,代码来源:draw_pt.c


示例19: draw_set_driver_clipping

/* With a little more work, llvmpipe will be able to turn this off and
 * do its own x/y clipping.  
 *
 * Some hardware can turn off clipping altogether - in particular any
 * hardware with a TNL unit can do its own clipping, even if it is
 * relying on the draw module for some other reason.
 * Setting bypass_clip_points to achieve d3d-style point clipping (the driver
 * will need to do the "vp scissoring") _requires_ the driver to implement
 * wide points / point sprites itself (points will still be clipped if rasterizer
 * point_tri_clip isn't set). Only relevant if bypass_clip_xy isn't set.
 */
void draw_set_driver_clipping( struct draw_context *draw,
                               boolean bypass_clip_xy,
                               boolean bypass_clip_z,
                               boolean guard_band_xy,
                               boolean bypass_clip_points)
{
   draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );

   draw->driver.bypass_clip_xy = bypass_clip_xy;
   draw->driver.bypass_clip_z = bypass_clip_z;
   draw->driver.guard_band_xy = guard_band_xy;
   draw->driver.bypass_clip_points = bypass_clip_points;
   draw_update_clip_flags(draw);
}
开发者ID:daniel-schuermann,项目名称:mesa,代码行数:25,代码来源:draw_context.c


示例20: draw_set_vertex_elements

void
draw_set_vertex_elements(struct draw_context *draw,
                         unsigned count,
                         const struct pipe_vertex_element *elements)
{
   assert(count <= PIPE_MAX_ATTRIBS);

   /* We could improve this by only flushing the frontend and the fetch part
    * of the middle. This would avoid recalculating the emit keys.*/
   draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );

   memcpy(draw->pt.vertex_element, elements, count * sizeof(elements[0]));
   draw->pt.nr_vertex_elements = count;
}
开发者ID:Forzaferrarileo,项目名称:mesa,代码行数:14,代码来源:draw_context.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ draw_flush函数代码示例发布时间:2022-05-30
下一篇:
C++ draw_cursor函数代码示例发布时间: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