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

C++ i830_context函数代码示例

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

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



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

示例1: i830CullFaceFrontFace

static void
i830CullFaceFrontFace(struct gl_context * ctx, GLenum unused)
{
   struct i830_context *i830 = i830_context(ctx);
   GLuint mode;

   DBG("%s\n", __FUNCTION__);
   
   if (!ctx->Polygon.CullFlag) {
      mode = CULLMODE_NONE;
   }
   else if (ctx->Polygon.CullFaceMode != GL_FRONT_AND_BACK) {
      mode = CULLMODE_CW;

      if (ctx->Polygon.CullFaceMode == GL_FRONT)
         mode ^= (CULLMODE_CW ^ CULLMODE_CCW);
      if (ctx->Polygon.FrontFace != GL_CCW)
         mode ^= (CULLMODE_CW ^ CULLMODE_CCW);
   }
   else {
      mode = CULLMODE_BOTH;
   }

   I830_STATECHANGE(i830, I830_UPLOAD_CTX);
   i830->state.Ctx[I830_CTXREG_STATE3] &= ~CULLMODE_MASK;
   i830->state.Ctx[I830_CTXREG_STATE3] |= ENABLE_CULL_MODE | mode;
}
开发者ID:nikai3d,项目名称:mesa,代码行数:27,代码来源:i830_state.c


示例2: i830ShadeModel

/* In Mesa 3.5 we can reliably do native flatshading.
 */
static void
i830ShadeModel(struct gl_context * ctx, GLenum mode)
{
   struct i830_context *i830 = i830_context(ctx);
   I830_STATECHANGE(i830, I830_UPLOAD_CTX);


#define SHADE_MODE_MASK ((1<<10)|(1<<8)|(1<<6)|(1<<4))

   i830->state.Ctx[I830_CTXREG_STATE3] &= ~SHADE_MODE_MASK;

   if (mode == GL_FLAT) {
      i830->state.Ctx[I830_CTXREG_STATE3] |=
         (ALPHA_SHADE_MODE(SHADE_MODE_FLAT) | FOG_SHADE_MODE(SHADE_MODE_FLAT)
          | SPEC_SHADE_MODE(SHADE_MODE_FLAT) |
          COLOR_SHADE_MODE(SHADE_MODE_FLAT));
   }
   else {
      i830->state.Ctx[I830_CTXREG_STATE3] |=
         (ALPHA_SHADE_MODE(SHADE_MODE_LINEAR) |
          FOG_SHADE_MODE(SHADE_MODE_LINEAR) |
          SPEC_SHADE_MODE(SHADE_MODE_LINEAR) |
          COLOR_SHADE_MODE(SHADE_MODE_LINEAR));
   }
}
开发者ID:nikai3d,项目名称:mesa,代码行数:27,代码来源:i830_state.c


示例3: i830EvalLogicOpBlendState

/**
 * Makes sure that the proper enables are set for LogicOp, Independant Alpha
 * Blend, and Blending.  It needs to be called from numerous places where we
 * could change the LogicOp or Independant Alpha Blend without subsequent
 * calls to glEnable.
 * 
 * \todo
 * This function is substantially different from the old i830-specific driver.
 * I'm not sure which is correct.
 */
static void
i830EvalLogicOpBlendState(struct gl_context * ctx)
{
   struct i830_context *i830 = i830_context(ctx);

   I830_STATECHANGE(i830, I830_UPLOAD_CTX);

   if (_mesa_rgba_logicop_enabled(ctx)) {
      i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~(ENABLE_COLOR_BLEND |
                                                  ENABLE_LOGIC_OP_MASK);
      i830->state.Ctx[I830_CTXREG_ENABLES_1] |= (DISABLE_COLOR_BLEND |
                                                 ENABLE_LOGIC_OP);
   }
   else if (ctx->Color.BlendEnabled) {
      i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~(ENABLE_COLOR_BLEND |
                                                  ENABLE_LOGIC_OP_MASK);
      i830->state.Ctx[I830_CTXREG_ENABLES_1] |= (ENABLE_COLOR_BLEND |
                                                 DISABLE_LOGIC_OP);
   }
   else {
      i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~(ENABLE_COLOR_BLEND |
                                                  ENABLE_LOGIC_OP_MASK);
      i830->state.Ctx[I830_CTXREG_ENABLES_1] |= (DISABLE_COLOR_BLEND |
                                                 DISABLE_LOGIC_OP);
   }
}
开发者ID:nikai3d,项目名称:mesa,代码行数:36,代码来源:i830_state.c


示例4: leave_meta_state

static void
leave_meta_state(struct intel_context *intel)
{
   struct i830_context *i830 = i830_context(&intel->ctx);
   intel_region_release(&i830->meta.draw_region);
   intel_region_release(&i830->meta.depth_region);
/*    intel_region_release(intel, &i830->meta.tex_region[0]); */
   SET_STATE(i830, state);
}
开发者ID:Multi2Sim,项目名称:m2s-bench-parsec-3.0-src,代码行数:9,代码来源:i830_metaops.c


示例5: i830PolygonStipple

/* =============================================================
 * Polygon stipple
 *
 * The i830 supports a 4x4 stipple natively, GL wants 32x32.
 * Fortunately stipple is usually a repeating pattern.
 */
static void
i830PolygonStipple(struct gl_context * ctx, const GLubyte * mask)
{
   struct i830_context *i830 = i830_context(ctx);
   const GLubyte *m;
   GLubyte p[4];
   int i, j, k;
   int active = (ctx->Polygon.StippleFlag &&
                 i830->intel.reduced_primitive == GL_TRIANGLES);
   GLuint newMask;

   if (active) {
      I830_STATECHANGE(i830, I830_UPLOAD_STIPPLE);
      i830->state.Stipple[I830_STPREG_ST1] &= ~ST1_ENABLE;
   }

   /* Use the already unpacked stipple data from the context rather than the
    * uninterpreted mask passed in.
    */
   mask = (const GLubyte *)ctx->PolygonStipple;
   m = mask;

   p[0] = mask[12] & 0xf;
   p[0] |= p[0] << 4;
   p[1] = mask[8] & 0xf;
   p[1] |= p[1] << 4;
   p[2] = mask[4] & 0xf;
   p[2] |= p[2] << 4;
   p[3] = mask[0] & 0xf;
   p[3] |= p[3] << 4;

   for (k = 0; k < 8; k++)
      for (j = 3; j >= 0; j--)
         for (i = 0; i < 4; i++, m++)
            if (*m != p[j]) {
               i830->intel.hw_stipple = 0;
               return;
            }

   newMask = (((p[0] & 0xf) << 0) |
              ((p[1] & 0xf) << 4) |
              ((p[2] & 0xf) << 8) | ((p[3] & 0xf) << 12));


   if (newMask == 0xffff || newMask == 0x0) {
      /* this is needed to make conform pass */
      i830->intel.hw_stipple = 0;
      return;
   }

   i830->state.Stipple[I830_STPREG_ST1] &= ~0xffff;
   i830->state.Stipple[I830_STPREG_ST1] |= newMask;
   i830->intel.hw_stipple = 1;

   if (active)
      i830->state.Stipple[I830_STPREG_ST1] |= ST1_ENABLE;
}
开发者ID:ashmew2,项目名称:kolibriosSVN,代码行数:63,代码来源:i830_state.c


示例6: meta_draw_region

/* Select between front and back draw buffers.
 */
static void
meta_draw_region(struct intel_context *intel,
                 struct intel_region *color_region,
                 struct intel_region *depth_region)
{
   struct i830_context *i830 = i830_context(&intel->ctx);

   i830_state_draw_region(intel, &i830->meta, color_region, depth_region);
}
开发者ID:Multi2Sim,项目名称:m2s-bench-parsec-3.0-src,代码行数:11,代码来源:i830_metaops.c


示例7: i830LogicOp

static void
i830LogicOp(struct gl_context * ctx, GLenum opcode)
{
   struct i830_context *i830 = i830_context(ctx);
   int tmp = intel_translate_logic_op(opcode);

   DBG("%s\n", __FUNCTION__);
   
   I830_STATECHANGE(i830, I830_UPLOAD_CTX);
   i830->state.Ctx[I830_CTXREG_STATE4] &= ~LOGICOP_MASK;
   i830->state.Ctx[I830_CTXREG_STATE4] |= LOGIC_OP_FUNC(tmp);
}
开发者ID:nikai3d,项目名称:mesa,代码行数:12,代码来源:i830_state.c


示例8: i830UpdateTextureState

void
i830UpdateTextureState(struct intel_context *intel)
{
   struct i830_context *i830 = i830_context(&intel->ctx);
   GLboolean ok = GL_TRUE;
   GLuint i;

   for (i = 0; i < I830_TEX_UNITS && ok; i++) {
      switch (intel->ctx.Texture.Unit[i]._ReallyEnabled) {
      case TEXTURE_1D_BIT:
      case TEXTURE_2D_BIT:
      case TEXTURE_CUBE_BIT:
         ok = i830_update_tex_unit(intel, i, TEXCOORDS_ARE_NORMAL);
         break;
      case TEXTURE_RECT_BIT:
         ok = i830_update_tex_unit(intel, i, TEXCOORDS_ARE_IN_TEXELUNITS);
         break;
      case 0:{
	 struct i830_context *i830 = i830_context(&intel->ctx);
         if (i830->state.active & I830_UPLOAD_TEX(i)) 
            I830_ACTIVESTATE(i830, I830_UPLOAD_TEX(i), GL_FALSE);

	 if (i830->state.tex_buffer[i] != NULL) {
	    dri_bo_unreference(i830->state.tex_buffer[i]);
	    i830->state.tex_buffer[i] = NULL;
	 }
         break;
      }
      case TEXTURE_3D_BIT:
      default:
         ok = GL_FALSE;
         break;
      }
   }

   FALLBACK(intel, I830_FALLBACK_TEXTURE, !ok);

   if (ok)
      i830EmitTextureBlend(i830);
}
开发者ID:freedesktop-unofficial-mirror,项目名称:nouveau__mesa,代码行数:40,代码来源:i830_texstate.c


示例9: i830DepthFunc

static void
i830DepthFunc(struct gl_context * ctx, GLenum func)
{
   struct i830_context *i830 = i830_context(ctx);
   int test = intel_translate_compare_func(func);

   DBG("%s\n", __FUNCTION__);
   
   I830_STATECHANGE(i830, I830_UPLOAD_CTX);
   i830->state.Ctx[I830_CTXREG_STATE3] &= ~DEPTH_TEST_FUNC_MASK;
   i830->state.Ctx[I830_CTXREG_STATE3] |= (ENABLE_DEPTH_TEST_FUNC |
                                           DEPTH_TEST_FUNC(test));
}
开发者ID:nikai3d,项目名称:mesa,代码行数:13,代码来源:i830_state.c


示例10: update_specular

static void
update_specular(GLcontext * ctx)
{
   struct i830_context *i830 = i830_context(ctx);

   I830_STATECHANGE(i830, I830_UPLOAD_CTX);
   i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_SPEC_ADD_MASK;

   if (NEED_SECONDARY_COLOR(ctx))
      i830->state.Ctx[I830_CTXREG_ENABLES_1] |= ENABLE_SPEC_ADD;
   else
      i830->state.Ctx[I830_CTXREG_ENABLES_1] |= DISABLE_SPEC_ADD;
}
开发者ID:toastpp,项目名称:toastpp,代码行数:13,代码来源:i830_state.c


示例11: update_specular

static void
update_specular(struct gl_context * ctx)
{
   struct i830_context *i830 = i830_context(ctx);

   I830_STATECHANGE(i830, I830_UPLOAD_CTX);
   i830->state.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_SPEC_ADD_MASK;

   if (_mesa_need_secondary_color(ctx))
      i830->state.Ctx[I830_CTXREG_ENABLES_1] |= ENABLE_SPEC_ADD;
   else
      i830->state.Ctx[I830_CTXREG_ENABLES_1] |= DISABLE_SPEC_ADD;
}
开发者ID:nikai3d,项目名称:mesa,代码行数:13,代码来源:i830_state.c


示例12: install_meta_state

/* Operations where the 3D engine is decoupled temporarily from the
 * current GL state and used for other purposes than simply rendering
 * incoming triangles.
 */
static void
install_meta_state(struct intel_context *intel)
{
   struct i830_context *i830 = i830_context(&intel->ctx);
   memcpy(&i830->meta, &i830->initial, sizeof(i830->meta));

   i830->meta.active = ACTIVE;
   i830->meta.emitted = 0;

   SET_STATE(i830, meta);
   set_vertex_format(intel);
   set_no_texture(intel);
}
开发者ID:Multi2Sim,项目名称:m2s-bench-parsec-3.0-src,代码行数:17,代码来源:i830_metaops.c


示例13: set_no_stencil_write

static void
set_no_stencil_write(struct intel_context *intel)
{
   struct i830_context *i830 = i830_context(&intel->ctx);

   /* ctx->Driver.Enable( ctx, GL_STENCIL_TEST, GL_FALSE )
    */
   i830->meta.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_STENCIL_TEST;
   i830->meta.Ctx[I830_CTXREG_ENABLES_2] &= ~ENABLE_STENCIL_WRITE;
   i830->meta.Ctx[I830_CTXREG_ENABLES_1] |= DISABLE_STENCIL_TEST;
   i830->meta.Ctx[I830_CTXREG_ENABLES_2] |= DISABLE_STENCIL_WRITE;

   i830->meta.emitted &= ~I830_UPLOAD_CTX;
}
开发者ID:Multi2Sim,项目名称:m2s-bench-parsec-3.0-src,代码行数:14,代码来源:i830_metaops.c


示例14: set_vertex_format

static void
set_vertex_format(struct intel_context *intel)
{
   struct i830_context *i830 = i830_context(&intel->ctx);
   i830->meta.Ctx[I830_CTXREG_VF] = (_3DSTATE_VFT0_CMD |
                                     VFT0_TEX_COUNT(1) |
                                     VFT0_DIFFUSE | VFT0_XYZ);
   i830->meta.Ctx[I830_CTXREG_VF2] = (_3DSTATE_VFT1_CMD |
                                      VFT1_TEX0_FMT(TEXCOORDFMT_2D) |
                                      VFT1_TEX1_FMT(TEXCOORDFMT_2D) |
                                      VFT1_TEX2_FMT(TEXCOORDFMT_2D) |
                                      VFT1_TEX3_FMT(TEXCOORDFMT_2D));
   i830->meta.emitted &= ~I830_UPLOAD_CTX;
}
开发者ID:Multi2Sim,项目名称:m2s-bench-parsec-3.0-src,代码行数:14,代码来源:i830_metaops.c


示例15: i830StencilMaskSeparate

static void
i830StencilMaskSeparate(struct gl_context * ctx, GLenum face, GLuint mask)
{
   struct i830_context *i830 = i830_context(ctx);

   DBG("%s : mask 0x%x\n", __FUNCTION__, mask);
   
   mask = mask & 0xff;

   I830_STATECHANGE(i830, I830_UPLOAD_CTX);
   i830->state.Ctx[I830_CTXREG_STATE4] &= ~MODE4_ENABLE_STENCIL_WRITE_MASK;
   i830->state.Ctx[I830_CTXREG_STATE4] |= (ENABLE_STENCIL_WRITE_MASK |
                                           STENCIL_WRITE_MASK(mask));
}
开发者ID:nikai3d,项目名称:mesa,代码行数:14,代码来源:i830_state.c


示例16: set_no_depth_write

static void
set_no_depth_write(struct intel_context *intel)
{
   struct i830_context *i830 = i830_context(&intel->ctx);

   /* ctx->Driver.Enable( ctx, GL_DEPTH_TEST, GL_FALSE )
    */
   i830->meta.Ctx[I830_CTXREG_ENABLES_1] &= ~ENABLE_DIS_DEPTH_TEST_MASK;
   i830->meta.Ctx[I830_CTXREG_ENABLES_2] &= ~ENABLE_DIS_DEPTH_WRITE_MASK;
   i830->meta.Ctx[I830_CTXREG_ENABLES_1] |= DISABLE_DEPTH_TEST;
   i830->meta.Ctx[I830_CTXREG_ENABLES_2] |= DISABLE_DEPTH_WRITE;

   i830->meta.emitted &= ~I830_UPLOAD_CTX;
}
开发者ID:Multi2Sim,项目名称:m2s-bench-parsec-3.0-src,代码行数:14,代码来源:i830_metaops.c


示例17: i830PointSize

static void
i830PointSize(struct gl_context * ctx, GLfloat size)
{
   struct i830_context *i830 = i830_context(ctx);
   GLint point_size = (int) size;

   DBG("%s\n", __FUNCTION__);
   
   point_size = CLAMP(point_size, 1, 256);
   I830_STATECHANGE(i830, I830_UPLOAD_CTX);
   i830->state.Ctx[I830_CTXREG_STATE5] &= ~FIXED_POINT_WIDTH_MASK;
   i830->state.Ctx[I830_CTXREG_STATE5] |= (ENABLE_FIXED_POINT_WIDTH |
                                           FIXED_POINT_WIDTH(point_size));
}
开发者ID:nikai3d,项目名称:mesa,代码行数:14,代码来源:i830_state.c


示例18: i830DepthMask

static void
i830DepthMask(struct gl_context * ctx, GLboolean flag)
{
   struct i830_context *i830 = i830_context(ctx);

   DBG("%s flag (%d)\n", __FUNCTION__, flag);
   
   I830_STATECHANGE(i830, I830_UPLOAD_CTX);

   i830->state.Ctx[I830_CTXREG_ENABLES_2] &= ~ENABLE_DIS_DEPTH_WRITE_MASK;

   if (flag && ctx->Depth.Test)
      i830->state.Ctx[I830_CTXREG_ENABLES_2] |= ENABLE_DEPTH_WRITE;
   else
      i830->state.Ctx[I830_CTXREG_ENABLES_2] |= DISABLE_DEPTH_WRITE;
}
开发者ID:nikai3d,项目名称:mesa,代码行数:16,代码来源:i830_state.c


示例19: i830Fogfv

/* =============================================================
 * Fog
 */
static void
i830Fogfv(struct gl_context * ctx, GLenum pname, const GLfloat * param)
{
   struct i830_context *i830 = i830_context(ctx);

   DBG("%s\n", __FUNCTION__);
   
   if (pname == GL_FOG_COLOR) {
      GLuint color = (((GLubyte) (ctx->Fog.Color[0] * 255.0F) << 16) |
                      ((GLubyte) (ctx->Fog.Color[1] * 255.0F) << 8) |
                      ((GLubyte) (ctx->Fog.Color[2] * 255.0F) << 0));

      I830_STATECHANGE(i830, I830_UPLOAD_CTX);
      i830->state.Ctx[I830_CTXREG_FOGCOLOR] =
         (_3DSTATE_FOG_COLOR_CMD | color);
   }
}
开发者ID:nikai3d,项目名称:mesa,代码行数:20,代码来源:i830_state.c


示例20: i830BlendColor

static void
i830BlendColor(struct gl_context * ctx, const GLfloat color[4])
{
   struct i830_context *i830 = i830_context(ctx);
   GLubyte r, g, b, a;

   DBG("%s\n", __FUNCTION__);
   
   UNCLAMPED_FLOAT_TO_UBYTE(r, color[RCOMP]);
   UNCLAMPED_FLOAT_TO_UBYTE(g, color[GCOMP]);
   UNCLAMPED_FLOAT_TO_UBYTE(b, color[BCOMP]);
   UNCLAMPED_FLOAT_TO_UBYTE(a, color[ACOMP]);

   I830_STATECHANGE(i830, I830_UPLOAD_CTX);
   i830->state.Ctx[I830_CTXREG_BLENDCOLOR1] =
      (a << 24) | (r << 16) | (g << 8) | b;
}
开发者ID:nikai3d,项目名称:mesa,代码行数:17,代码来源:i830_state.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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