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

C++ i915_context函数代码示例

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

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



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

示例1: i915_set_fragment_sampler_views

static void i915_set_fragment_sampler_views(struct pipe_context *pipe,
                                            unsigned num,
                                            struct pipe_sampler_view **views)
{
   struct i915_context *i915 = i915_context(pipe);
   uint i;

   assert(num <= PIPE_MAX_SAMPLERS);

   /* Check for no-op */
   if (num == i915->num_fragment_sampler_views &&
       !memcmp(i915->fragment_sampler_views, views, num * sizeof(struct pipe_sampler_view *)))
      return;

   /* Fixes wrong texture in texobj with VBUF */
   draw_flush(i915->draw);

   for (i = 0; i < num; i++)
      pipe_sampler_view_reference(&i915->fragment_sampler_views[i],
                                  views[i]);

   for (i = num; i < i915->num_fragment_sampler_views; i++)
      pipe_sampler_view_reference(&i915->fragment_sampler_views[i],
                                  NULL);

   i915->num_fragment_sampler_views = num;

   i915->dirty |= I915_NEW_SAMPLER_VIEW;
}
开发者ID:nikai3d,项目名称:mesa,代码行数:29,代码来源:i915_state.c


示例2: i915_set_vertex_buffers

static void i915_set_vertex_buffers(struct pipe_context *pipe,
                                    unsigned count,
                                    const struct pipe_vertex_buffer *buffers)
{
   struct i915_context *i915 = i915_context(pipe);
   struct draw_context *draw = i915->draw;
   int i;

   util_copy_vertex_buffers(i915->saved_vertex_buffers,
                            &i915->saved_nr_vertex_buffers,
                            buffers, count);
#if 0
   /* XXX doesn't look like this is needed */
   /* unmap old */
   for (i = 0; i < i915->num_vertex_buffers; i++) {
      draw_set_mapped_vertex_buffer(draw, i, NULL);
   }
#endif

   /* pass-through to draw module */
   draw_set_vertex_buffers(draw, count, buffers);

   /* map new */
   for (i = 0; i < count; i++) {
      void *buf = i915_buffer(buffers[i].buffer)->data;
      draw_set_mapped_vertex_buffer(draw, i, buf);
   }
}
开发者ID:nikai3d,项目名称:mesa,代码行数:28,代码来源:i915_state.c


示例3: i915_bind_fragment_sampler_states

static void i915_bind_fragment_sampler_states(struct pipe_context *pipe,
                                              unsigned start,
                                              unsigned num,
                                              void **samplers)
{
   struct i915_context *i915 = i915_context(pipe);
   unsigned i;

   /* Check for no-op */
   if (num == i915->num_samplers &&
       !memcmp(i915->fragment_sampler + start, samplers,
               num * sizeof(void *)))
      return;

   for (i = 0; i < num; ++i)
      i915->fragment_sampler[i + start] = samplers[i];

   /* find highest non-null samplers[] entry */
   {
      unsigned j = MAX2(i915->num_samplers, start + num);
      while (j > 0 && i915->fragment_sampler[j - 1] == NULL)
         j--;
      i915->num_samplers = j;
   }

   i915->dirty |= I915_NEW_SAMPLER;
}
开发者ID:BNieuwenhuizen,项目名称:mesa,代码行数:27,代码来源:i915_state.c


示例4: i915_delete_vs_state

static void i915_delete_vs_state(struct pipe_context *pipe, void *shader)
{
   struct i915_context *i915 = i915_context(pipe);

   /* just pass-through to draw module */
   draw_delete_vertex_shader(i915->draw, (struct draw_vertex_shader *) shader);
}
开发者ID:Bluerise,项目名称:bitrig-xenocara,代码行数:7,代码来源:i915_state.c


示例5: i915_transfer_destroy

static void
i915_transfer_destroy(struct pipe_context *pipe,
                      struct pipe_transfer *transfer)
{
    struct i915_context *i915 = i915_context(pipe);
    util_slab_free(&i915->transfer_pool, transfer);
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:7,代码来源:i915_resource_buffer.c


示例6: i915_set_vertex_sampler_views

static void
i915_set_vertex_sampler_views(struct pipe_context *pipe,
                              unsigned num,
                              struct pipe_sampler_view **views)
{
   struct i915_context *i915 = i915_context(pipe);
   uint i;

   assert(num <= Elements(i915->vertex_sampler_views));

   /* Check for no-op */
   if (num == i915->num_vertex_sampler_views &&
       !memcmp(i915->vertex_sampler_views, views, num * sizeof(struct pipe_sampler_view *))) {
      return;
   }

   for (i = 0; i < Elements(i915->vertex_sampler_views); i++) {
      struct pipe_sampler_view *view = i < num ? views[i] : NULL;

      pipe_sampler_view_reference(&i915->vertex_sampler_views[i], view);
   }

   i915->num_vertex_sampler_views = num;

   draw_set_sampler_views(i915->draw,
                          PIPE_SHADER_VERTEX,
                          i915->vertex_sampler_views,
                          i915->num_vertex_sampler_views);
}
开发者ID:Bluerise,项目名称:bitrig-xenocara,代码行数:29,代码来源:i915_state.c


示例7: i915_get_transfer

static struct pipe_transfer *
i915_get_transfer(struct pipe_context *pipe,
                  struct pipe_resource *resource,
                  unsigned level,
                  unsigned usage,
                  const struct pipe_box *box)
{
   struct i915_context *i915 = i915_context(pipe);
   struct pipe_transfer *transfer;

   if (usage & PIPE_TRANSFER_MAP_PERMANENTLY) {
      return NULL;
   }

   transfer = util_slab_alloc(&i915->transfer_pool);
   if (transfer == NULL)
      return NULL;

   transfer->resource = resource;
   transfer->level = level;
   transfer->usage = usage;
   transfer->box = *box;

   /* Note strides are zero, this is ok for buffers, but not for
    * textures 2d & higher at least. 
    */
   return transfer;
}
开发者ID:ChillyWillyGuru,项目名称:RSXGL,代码行数:28,代码来源:i915_resource_buffer.c


示例8: i915_clear_depth_stencil_render

static void
i915_clear_depth_stencil_render(struct pipe_context *pipe,
                                struct pipe_surface *dst,
                                unsigned clear_flags,
                                double depth,
                                unsigned stencil,
                                unsigned dstx, unsigned dsty,
                                unsigned width, unsigned height)
{
   struct i915_context *i915 = i915_context(pipe);
   struct pipe_framebuffer_state fb_state;

   util_blitter_save_framebuffer(i915->blitter, &i915->framebuffer);

   fb_state.width = dst->width;
   fb_state.height = dst->height;
   fb_state.nr_cbufs = 0;
   fb_state.zsbuf = dst;
   pipe->set_framebuffer_state(pipe, &fb_state);

   if (i915->dirty)
      i915_update_derived(i915);

   i915_clear_emit(pipe, clear_flags & PIPE_CLEAR_DEPTHSTENCIL,
                   NULL, depth, stencil,
                   dstx, dsty, width, height);

   pipe->set_framebuffer_state(pipe, &i915->blitter->saved_fb_state);
   util_unreference_framebuffer_state(&i915->blitter->saved_fb_state);
   i915->blitter->saved_fb_state.nr_cbufs = ~0;
}
开发者ID:mlankhorst,项目名称:Mesa-3D,代码行数:31,代码来源:i915_surface.c


示例9: i915_surface_copy_render

static void
i915_surface_copy_render(struct pipe_context *pipe,
                         struct pipe_resource *dst, unsigned dst_level,
                         unsigned dstx, unsigned dsty, unsigned dstz,
                         struct pipe_resource *src, unsigned src_level,
                         const struct pipe_box *src_box)
{
   struct i915_context *i915 = i915_context(pipe);

   /* Fallback for buffers. */
   if (dst->target == PIPE_BUFFER && src->target == PIPE_BUFFER) {
      util_resource_copy_region(pipe, dst, dst_level, dstx, dsty, dstz,
                                src, src_level, src_box);
      return;
   }

   if (!util_blitter_is_copy_supported(i915->blitter, dst, src,
                                       PIPE_MASK_RGBAZS)) {
      util_resource_copy_region(pipe, dst, dst_level, dstx, dsty, dstz,
                                src, src_level, src_box);
      return;
   }

   i915_util_blitter_save_states(i915);

   util_blitter_copy_texture(i915->blitter, dst, dst_level, dstx, dsty, dstz,
                            src, src_level, src_box, PIPE_MASK_RGBAZS, TRUE);
}
开发者ID:MaikuMori,项目名称:mesa,代码行数:28,代码来源:i915_surface.c


示例10: i915_clear

/**
 * Clear the given buffers to the specified values.
 * No masking, no scissor (clear entire buffer).
 */
void
i915_clear(struct pipe_context *pipe, unsigned buffers, const float *rgba,
           double depth, unsigned stencil)
{
   util_clear(pipe, &i915_context(pipe)->framebuffer, buffers, rgba, depth,
              stencil);
}
开发者ID:1065672644894730302,项目名称:Chromium,代码行数:11,代码来源:i915_clear.c


示例11: i915_set_sampler_textures

static void i915_set_sampler_textures(struct pipe_context *pipe,
                                      unsigned num,
                                      struct pipe_texture **texture)
{
   struct i915_context *i915 = i915_context(pipe);
   uint i;

   assert(num <= PIPE_MAX_SAMPLERS);

   /* Check for no-op */
   if (num == i915->num_textures &&
       !memcmp(i915->texture, texture, num * sizeof(struct pipe_texture *)))
      return;

   /* Fixes wrong texture in texobj with VBUF */
   draw_flush(i915->draw);

   for (i = 0; i < num; i++)
      pipe_texture_reference((struct pipe_texture **) &i915->texture[i],
                             texture[i]);

   for (i = num; i < i915->num_textures; i++)
      pipe_texture_reference((struct pipe_texture **) &i915->texture[i],
                             NULL);

   i915->num_textures = num;

   i915->dirty |= I915_NEW_TEXTURE;
}
开发者ID:astrofimov,项目名称:vgallium,代码行数:29,代码来源:i915_state.c


示例12: i915_blit

static void
i915_blit(struct pipe_context *pipe, const struct pipe_blit_info *blit_info)
{
   struct i915_context *i915 = i915_context(pipe);
   struct pipe_blit_info info = *blit_info;

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

   if (info.mask & PIPE_MASK_S) {
      debug_printf("i915: cannot blit stencil, skipping\n");
      info.mask &= ~PIPE_MASK_S;
   }

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

   i915_util_blitter_save_states(i915);

   util_blitter_blit(i915->blitter, &info);
}
开发者ID:MaikuMori,项目名称:mesa,代码行数:26,代码来源:i915_surface.c


示例13: i915_set_fragment_sampler_views

static void i915_set_fragment_sampler_views(struct pipe_context *pipe,
                                            unsigned num,
                                            struct pipe_sampler_view **views)
{
   struct i915_context *i915 = i915_context(pipe);
   uint i;

   assert(num <= PIPE_MAX_SAMPLERS);

   /* Check for no-op */
   if (num == i915->num_fragment_sampler_views &&
       !memcmp(i915->fragment_sampler_views, views, num * sizeof(struct pipe_sampler_view *)))
      return;

   for (i = 0; i < num; i++) {
      /* Note: we're using pipe_sampler_view_release() here to work around
       * a possible crash when the old view belongs to another context that
       * was already destroyed.
       */
      pipe_sampler_view_release(pipe, &i915->fragment_sampler_views[i]);
      pipe_sampler_view_reference(&i915->fragment_sampler_views[i],
                                  views[i]);
   }

   for (i = num; i < i915->num_fragment_sampler_views; i++)
      pipe_sampler_view_release(pipe, &i915->fragment_sampler_views[i]);

   i915->num_fragment_sampler_views = num;

   i915->dirty |= I915_NEW_SAMPLER_VIEW;
}
开发者ID:Bluerise,项目名称:bitrig-xenocara,代码行数:31,代码来源:i915_state.c


示例14: i915_clear_render_target_render

static void
i915_clear_render_target_render(struct pipe_context *pipe,
                                struct pipe_surface *dst,
                                const union pipe_color_union *color,
                                unsigned dstx, unsigned dsty,
                                unsigned width, unsigned height)
{
   struct i915_context *i915 = i915_context(pipe);
   struct pipe_framebuffer_state fb_state;

   util_blitter_save_framebuffer(i915->blitter, &i915->framebuffer);

   fb_state.width = dst->width;
   fb_state.height = dst->height;
   fb_state.nr_cbufs = 1;
   fb_state.cbufs[0] = dst;
   fb_state.zsbuf = NULL;
   pipe->set_framebuffer_state(pipe, &fb_state);

   if (i915->dirty)
      i915_update_derived(i915);

   i915_clear_emit(pipe, PIPE_CLEAR_COLOR, color, 0.0, 0x0,
                   dstx, dsty, width, height);

   pipe->set_framebuffer_state(pipe, &i915->blitter->saved_fb_state);
   util_unreference_framebuffer_state(&i915->blitter->saved_fb_state);
   i915->blitter->saved_fb_state.nr_cbufs = ~0;
}
开发者ID:mlankhorst,项目名称:Mesa-3D,代码行数:29,代码来源:i915_surface.c


示例15: i915_bind_vertex_sampler_states

static void
i915_bind_vertex_sampler_states(struct pipe_context *pipe,
                                unsigned num_samplers,
                                void **samplers)
{
   struct i915_context *i915 = i915_context(pipe);
   unsigned i;

   assert(num_samplers <= Elements(i915->vertex_samplers));

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

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

   i915->num_vertex_samplers = num_samplers;

   draw_set_samplers(i915->draw,
                     PIPE_SHADER_VERTEX,
                     i915->vertex_samplers,
                     i915->num_vertex_samplers);
}
开发者ID:Bluerise,项目名称:bitrig-xenocara,代码行数:27,代码来源:i915_state.c


示例16: i915_bind_vertex_sampler_states

static void
i915_bind_vertex_sampler_states(struct pipe_context *pipe,
                                unsigned start,
                                unsigned num,
                                void **samplers)
{
   struct i915_context *i915 = i915_context(pipe);
   unsigned i;

   assert(start + num <= ARRAY_SIZE(i915->vertex_samplers));

   /* Check for no-op */
   if (num == i915->num_vertex_samplers &&
       !memcmp(i915->vertex_samplers + start, samplers,
	       num * sizeof(void *)))
      return;

   for (i = 0; i < num; ++i)
      i915->vertex_samplers[i + start] = samplers[i];

   /* find highest non-null samplers[] entry */
   {
      unsigned j = MAX2(i915->num_vertex_samplers, start + num);
      while (j > 0 && i915->vertex_samplers[j - 1] == NULL)
         j--;
      i915->num_vertex_samplers = j;
   }

   draw_set_samplers(i915->draw,
                     PIPE_SHADER_VERTEX,
                     i915->vertex_samplers,
                     i915->num_vertex_samplers);
}
开发者ID:BNieuwenhuizen,项目名称:mesa,代码行数:33,代码来源:i915_state.c


示例17: i915_destroy

static void i915_destroy(struct pipe_context *pipe)
{
   struct i915_context *i915 = i915_context(pipe);
   int i;

   if (i915->blitter)
      util_blitter_destroy(i915->blitter);

   draw_destroy(i915->draw);

   if(i915->batch)
      i915->iws->batchbuffer_destroy(i915->batch);

   /* unbind framebuffer */
   for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
      pipe_surface_reference(&i915->framebuffer.cbufs[i], NULL);
   }
   pipe_surface_reference(&i915->framebuffer.zsbuf, NULL);

   /* unbind constant buffers */
   for (i = 0; i < PIPE_SHADER_TYPES; i++) {
      pipe_resource_reference(&i915->constants[i], NULL);
   }

   FREE(i915);
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:26,代码来源:i915_context.c


示例18: i915_render_prevalidate

static void
i915_render_prevalidate(struct intel_context *intel)
{
   struct i915_context *i915 = i915_context(&intel->ctx);

   i915ValidateFragmentProgram(i915);
}
开发者ID:freedesktop-unofficial-mirror,项目名称:openchrome__mesa-openchrome,代码行数:7,代码来源:i915_vtbl.c


示例19: i915_reduced_primitive_state

static void
i915_reduced_primitive_state(struct intel_context *intel, GLenum rprim)
{
   struct i915_context *i915 = i915_context(&intel->ctx);
   GLuint st1 = i915->state.Stipple[I915_STPREG_ST1];

   st1 &= ~ST1_ENABLE;

   switch (rprim) {
   case GL_QUADS: /* from RASTERIZE(GL_QUADS) in t_dd_tritemp.h */
   case GL_TRIANGLES:
      if (intel->ctx.Polygon.StippleFlag && intel->hw_stipple)
         st1 |= ST1_ENABLE;
      break;
   case GL_LINES:
   case GL_POINTS:
   default:
      break;
   }

   i915->intel.reduced_primitive = rprim;

   if (st1 != i915->state.Stipple[I915_STPREG_ST1]) {
      INTEL_FIREVERTICES(intel);

      I915_STATECHANGE(i915, I915_UPLOAD_STIPPLE);
      i915->state.Stipple[I915_STPREG_ST1] = st1;
   }
}
开发者ID:freedesktop-unofficial-mirror,项目名称:openchrome__mesa-openchrome,代码行数:29,代码来源:i915_vtbl.c


示例20: i915_clear_render_target_blitter

static void
i915_clear_render_target_blitter(struct pipe_context *pipe,
                                 struct pipe_surface *dst,
                                 const union pipe_color_union *color,
                                 unsigned dstx, unsigned dsty,
                                 unsigned width, unsigned height)
{
   struct i915_texture *tex = i915_texture(dst->texture);
   struct pipe_resource *pt = &tex->b.b;
   union util_color uc;
   unsigned offset = i915_texture_offset(tex, dst->u.tex.level, dst->u.tex.first_layer);

   assert(util_format_get_blockwidth(pt->format) == 1);
   assert(util_format_get_blockheight(pt->format) == 1);

   util_pack_color(color->f, dst->format, &uc);
   i915_fill_blit( i915_context(pipe),
                   util_format_get_blocksize(pt->format),
                   XY_COLOR_BLT_WRITE_ALPHA | XY_COLOR_BLT_WRITE_RGB,
                   (unsigned short) tex->stride,
                   tex->buffer, offset,
                   (short) dstx, (short) dsty,
                   (short) width, (short) height,
                   uc.ui );
}
开发者ID:mlankhorst,项目名称:Mesa-3D,代码行数:25,代码来源:i915_surface.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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