本文整理汇总了C++中FLUSH_BATCH函数的典型用法代码示例。如果您正苦于以下问题:C++ FLUSH_BATCH函数的具体用法?C++ FLUSH_BATCH怎么用?C++ FLUSH_BATCH使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FLUSH_BATCH函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mgaDDTexParameter
static void
mgaDDTexParameter( GLcontext *ctx, GLenum target,
struct gl_texture_object *tObj,
GLenum pname, const GLfloat *params )
{
mgaContextPtr mmesa = MGA_CONTEXT( ctx );
mgaTextureObjectPtr t;
t = (mgaTextureObjectPtr) tObj->DriverData;
/* If we don't have a hardware texture, it will be automatically
* created with current state before it is used, so we don't have
* to do anything now
*/
if ( (t == NULL) ||
(target != GL_TEXTURE_2D &&
target != GL_TEXTURE_RECTANGLE_NV) ) {
return;
}
switch (pname) {
case GL_TEXTURE_MIN_FILTER:
driSwapOutTextureObject( (driTextureObject *) t );
/* FALLTHROUGH */
case GL_TEXTURE_MAG_FILTER:
FLUSH_BATCH(mmesa);
mgaSetTexFilter( t, tObj->MinFilter, tObj->MagFilter );
break;
case GL_TEXTURE_WRAP_S:
case GL_TEXTURE_WRAP_T:
FLUSH_BATCH(mmesa);
mgaSetTexWrapping(t,tObj->WrapS,tObj->WrapT);
break;
case GL_TEXTURE_BORDER_COLOR:
FLUSH_BATCH(mmesa);
mgaSetTexBorderColor(t, tObj->_BorderChan);
break;
case GL_TEXTURE_BASE_LEVEL:
case GL_TEXTURE_MAX_LEVEL:
case GL_TEXTURE_MIN_LOD:
case GL_TEXTURE_MAX_LOD:
/* This isn't the most efficient solution but there doesn't appear to
* be a nice alternative. Since there's no LOD clamping,
* we just have to rely on loading the right subset of mipmap levels
* to simulate a clamped LOD.
*/
driSwapOutTextureObject( (driTextureObject *) t );
break;
default:
return;
}
}
示例2: mach64DDTexEnv
static void mach64DDTexEnv( struct gl_context *ctx, GLenum target,
GLenum pname, const GLfloat *param )
{
mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
#if 0
struct gl_texture_unit *texUnit;
GLubyte c[4];
#endif
if ( MACH64_DEBUG & DEBUG_VERBOSE_API ) {
fprintf( stderr, "%s( %s )\n",
__FUNCTION__, _mesa_lookup_enum_by_nr( pname ) );
}
switch ( pname ) {
case GL_TEXTURE_ENV_MODE:
FLUSH_BATCH( mmesa );
mmesa->new_state |= MACH64_NEW_TEXTURE | MACH64_NEW_ALPHA;
break;
#if 0
case GL_TEXTURE_ENV_COLOR:
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
CLAMPED_FLOAT_TO_UBYTE( c[0], texUnit->EnvColor[0] );
CLAMPED_FLOAT_TO_UBYTE( c[1], texUnit->EnvColor[1] );
CLAMPED_FLOAT_TO_UBYTE( c[2], texUnit->EnvColor[2] );
CLAMPED_FLOAT_TO_UBYTE( c[3], texUnit->EnvColor[3] );
mmesa->env_color = mach64PackColor( 32, c[0], c[1], c[2], c[3] );
if ( mmesa->setup.constant_color_c != mmesa->env_color ) {
FLUSH_BATCH( mmesa );
mmesa->setup.constant_color_c = mmesa->env_color;
mmesa->new_state |= MACH64_NEW_TEXTURE;
/* More complex multitexture/multipass fallbacks for GL_BLEND
* can be done later, but this allows a single pass GL_BLEND
* in some cases (ie. Performer town demo).
*/
mmesa->blend_flags &= ~MACH64_BLEND_ENV_COLOR;
if ( mmesa->env_color != 0x00000000 &&
mmesa->env_color != 0xff000000 &&
mmesa->env_color != 0x00ffffff &&
mmesa->env_color != 0xffffffff )) {
mmesa->blend_flags |= MACH64_BLEND_ENV_COLOR;
}
}
break;
#endif
default:
return;
}
示例3: i915_fill_blit
void
i915_fill_blit(struct i915_context *i915,
unsigned cpp,
unsigned rgba_mask,
unsigned short dst_pitch,
struct i915_winsys_buffer *dst_buffer,
unsigned dst_offset,
short x, short y,
short w, short h,
unsigned color)
{
unsigned BR13, CMD;
I915_DBG(DBG_BLIT, "%s dst:buf(%p)/%d+%d %d,%d sz:%dx%d\n",
__FUNCTION__, dst_buffer, dst_pitch, dst_offset, x, y, w, h);
if(!i915_winsys_validate_buffers(i915->batch, &dst_buffer, 1)) {
FLUSH_BATCH(NULL);
assert(i915_winsys_validate_buffers(i915->batch, &dst_buffer, 1));
}
switch (cpp) {
case 1:
case 2:
case 3:
BR13 = (((int) dst_pitch) & 0xffff) |
(0xF0 << 16) | (1 << 24);
CMD = XY_COLOR_BLT_CMD;
break;
case 4:
BR13 = (((int) dst_pitch) & 0xffff) |
(0xF0 << 16) | (1 << 24) | (1 << 25);
CMD = (XY_COLOR_BLT_CMD | rgba_mask);
break;
default:
return;
}
if (!BEGIN_BATCH(6)) {
FLUSH_BATCH(NULL);
assert(BEGIN_BATCH(6));
}
OUT_BATCH(CMD);
OUT_BATCH(BR13);
OUT_BATCH((y << 16) | x);
OUT_BATCH(((y + h) << 16) | (x + w));
OUT_RELOC_FENCED(dst_buffer, I915_USAGE_2D_TARGET, dst_offset);
OUT_BATCH(color);
i915_set_flush_dirty(i915, I915_FLUSH_CACHE);
}
示例4: r128TexParameter
static void r128TexParameter( GLcontext *ctx, GLenum target,
struct gl_texture_object *tObj,
GLenum pname, const GLfloat *params )
{
r128ContextPtr rmesa = R128_CONTEXT(ctx);
r128TexObjPtr t = (r128TexObjPtr)tObj->DriverData;
if ( R128_DEBUG & DEBUG_VERBOSE_API ) {
fprintf( stderr, "%s( %s )\n",
__FUNCTION__, _mesa_lookup_enum_by_nr( pname ) );
}
if ( ( target != GL_TEXTURE_2D ) && ( target != GL_TEXTURE_1D ) )
return;
switch ( pname ) {
case GL_TEXTURE_MIN_FILTER:
case GL_TEXTURE_MAG_FILTER:
if ( t->base.bound ) FLUSH_BATCH( rmesa );
r128SetTexFilter( t, tObj->MinFilter, tObj->MagFilter );
break;
case GL_TEXTURE_WRAP_S:
case GL_TEXTURE_WRAP_T:
if ( t->base.bound ) FLUSH_BATCH( rmesa );
r128SetTexWrap( t, tObj->WrapS, tObj->WrapT );
break;
case GL_TEXTURE_BORDER_COLOR:
if ( t->base.bound ) FLUSH_BATCH( rmesa );
r128SetTexBorderColor( t, tObj->BorderColor.f );
break;
case GL_TEXTURE_BASE_LEVEL:
case GL_TEXTURE_MAX_LEVEL:
case GL_TEXTURE_MIN_LOD:
case GL_TEXTURE_MAX_LOD:
/* This isn't the most efficient solution but there doesn't appear to
* be a nice alternative for R128. Since there's no LOD clamping,
* we just have to rely on loading the right subset of mipmap levels
* to simulate a clamped LOD.
*/
if ( t->base.bound ) FLUSH_BATCH( rmesa );
driSwapOutTextureObject( (driTextureObject *) t );
break;
default:
return;
}
}
示例5: i915_fill_blit
void
i915_fill_blit(struct i915_context *i915,
unsigned cpp,
unsigned short dst_pitch,
struct intel_buffer *dst_buffer,
unsigned dst_offset,
short x, short y,
short w, short h,
unsigned color)
{
unsigned BR13, CMD;
I915_DBG(i915,
"%s dst:buf(%p)/%d+%d %d,%d sz:%dx%d\n",
__FUNCTION__,
dst_buffer, dst_pitch, dst_offset, x, y, w, h);
switch (cpp) {
case 1:
case 2:
case 3:
BR13 = (((int) dst_pitch) & 0xffff) |
(0xF0 << 16) | (1 << 24);
CMD = XY_COLOR_BLT_CMD;
break;
case 4:
BR13 = (((int) dst_pitch) & 0xffff) |
(0xF0 << 16) | (1 << 24) | (1 << 25);
CMD = (XY_COLOR_BLT_CMD | XY_COLOR_BLT_WRITE_ALPHA |
XY_COLOR_BLT_WRITE_RGB);
break;
default:
return;
}
if (!BEGIN_BATCH(6, 1)) {
FLUSH_BATCH(NULL);
assert(BEGIN_BATCH(6, 1));
}
OUT_BATCH(CMD);
OUT_BATCH(BR13);
OUT_BATCH((y << 16) | x);
OUT_BATCH(((y + h) << 16) | (x + w));
OUT_RELOC(dst_buffer, INTEL_USAGE_2D_TARGET, dst_offset);
OUT_BATCH(color);
FLUSH_BATCH(NULL);
}
示例6: tdfxDDStencilMask
static void tdfxDDStencilMask( GLcontext *ctx, GLuint mask )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
FLUSH_BATCH( fxMesa );
fxMesa->new_state |= TDFX_NEW_STENCIL;
}
示例7: mgaDDDrawBuffer
static void mgaDDDrawBuffer(GLcontext *ctx, GLenum mode )
{
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
FLUSH_BATCH( mmesa );
/*
* _DrawDestMask is easier to cope with than <mode>.
*/
switch ( ctx->Color._DrawDestMask[0] ) {
case DD_FRONT_LEFT_BIT:
mmesa->setup.dstorg = mmesa->mgaScreen->frontOffset;
mmesa->dirty |= MGA_UPLOAD_CONTEXT;
mmesa->draw_buffer = MGA_FRONT;
mgaXMesaSetFrontClipRects( mmesa );
FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
case DD_BACK_LEFT_BIT:
mmesa->setup.dstorg = mmesa->mgaScreen->backOffset;
mmesa->draw_buffer = MGA_BACK;
mmesa->dirty |= MGA_UPLOAD_CONTEXT;
mgaXMesaSetBackClipRects( mmesa );
FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
default:
/* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_TRUE );
return;
}
/* We want to update the s/w rast state too so that r200SetBuffer()
* gets called.
*/
_swrast_DrawBuffer(ctx, mode);
}
示例8: mgaFallback
void mgaFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
GLuint oldfallback = mmesa->Fallback;
if (mode) {
mmesa->Fallback |= bit;
if (oldfallback == 0) {
FLUSH_BATCH(mmesa);
_swsetup_Wakeup( ctx );
mmesa->RenderIndex = ~0;
if (MGA_DEBUG & DEBUG_VERBOSE_FALLBACK) {
fprintf(stderr, "MGA begin rasterization fallback: 0x%x %s\n",
bit, getFallbackString(bit));
}
}
}
else {
mmesa->Fallback &= ~bit;
if (oldfallback == bit) {
_swrast_flush( ctx );
tnl->Driver.Render.Start = mgaCheckTexSizes;
tnl->Driver.Render.PrimitiveNotify = mgaRenderPrimitive;
tnl->Driver.Render.Finish = mgaRenderFinish;
tnl->Driver.Render.BuildVertices = mgaBuildVertices;
mmesa->NewGLState |= (_MGA_NEW_RENDERSTATE |
_MGA_NEW_RASTERSETUP);
if (MGA_DEBUG & DEBUG_VERBOSE_FALLBACK) {
fprintf(stderr, "MGA end rasterization fallback: 0x%x %s\n",
bit, getFallbackString(bit));
}
}
}
}
示例9: gammaDDFrontFace
static void gammaDDFrontFace( GLcontext *ctx, GLenum mode )
{
gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
FLUSH_BATCH( gmesa );
gmesa->new_state |= GAMMA_NEW_CULL;
}
示例10: gammaDDFogfv
static void gammaDDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *param )
{
gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
FLUSH_BATCH( gmesa );
gmesa->new_state |= GAMMA_NEW_FOG;
}
示例11: gammaDDDepthMask
static void gammaDDDepthMask( GLcontext *ctx, GLboolean flag )
{
gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
FLUSH_BATCH( gmesa );
gmesa->new_state |= GAMMA_NEW_DEPTH;
}
示例12: gammaDDDepthFunc
static void gammaDDDepthFunc( GLcontext *ctx, GLenum func )
{
gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
FLUSH_BATCH( gmesa );
gmesa->new_state |= GAMMA_NEW_DEPTH;
}
示例13: r128SpanRenderStart
void r128SpanRenderStart( GLcontext *ctx )
{
r128ContextPtr rmesa = R128_CONTEXT(ctx);
FLUSH_BATCH(rmesa);
LOCK_HARDWARE(rmesa);
r128WaitForIdleLocked( rmesa );
}
示例14: tdfxDDFrontFace
static void tdfxDDFrontFace( GLcontext *ctx, GLenum mode )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT( ctx );
FLUSH_BATCH( fxMesa );
fxMesa->new_state |= TDFX_NEW_CULL;
}
示例15: tdfxDDScissor
static void
tdfxDDScissor(GLcontext * ctx, GLint x, GLint y, GLsizei w, GLsizei h)
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
FLUSH_BATCH( fxMesa );
fxMesa->new_state |= TDFX_NEW_CLIP;
}