本文整理汇总了C++中context_dirty函数的典型用法代码示例。如果您正苦于以下问题:C++ context_dirty函数的具体用法?C++ context_dirty怎么用?C++ context_dirty使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了context_dirty函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: nv10_zclear
static void
nv10_zclear(struct gl_context *ctx, GLbitfield *buffers)
{
/*
* Pre-nv17 cards don't have native support for fast Z clears,
* but in some cases we can still "clear" the Z buffer without
* actually blitting to it if we're willing to sacrifice a few
* bits of depth precision.
*
* Each time a clear is requested we modify the viewport
* transform in such a way that the old contents of the depth
* buffer are clamped to the requested clear value when
* they're read by the GPU.
*/
struct nouveau_context *nctx = to_nouveau_context(ctx);
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct nouveau_framebuffer *nfb = to_nouveau_framebuffer(fb);
struct nouveau_surface *s = &to_nouveau_renderbuffer(
fb->Attachment[BUFFER_DEPTH].Renderbuffer)->surface;
if (nv10_use_viewport_zclear(ctx)) {
int x, y, w, h;
float z = ctx->Depth.Clear;
uint32_t value = pack_zs_f(s->format, z, 0);
get_scissors(fb, &x, &y, &w, &h);
*buffers &= ~BUFFER_BIT_DEPTH;
if (use_fast_zclear(ctx, *buffers)) {
if (nfb->hierz.clear_value != value) {
/* Don't fast clear if we're changing
* the depth value. */
nfb->hierz.clear_value = value;
} else if (z == 0.0) {
nctx->hierz.clear_seq++;
context_dirty(ctx, ZCLEAR);
if ((nctx->hierz.clear_seq & 7) != 0 &&
nctx->hierz.clear_seq != 1)
/* We didn't wrap around -- no need to
* clear the depth buffer for real. */
return;
} else if (z == 1.0) {
nctx->hierz.clear_seq--;
context_dirty(ctx, ZCLEAR);
if ((nctx->hierz.clear_seq & 7) != 7)
/* No wrap around */
return;
}
}
value = pack_zs_f(s->format,
(z + (nctx->hierz.clear_seq & 7)) / 8, 0);
context_drv(ctx)->surface_fill(ctx, s, ~0, value, x, y, w, h);
}
}
开发者ID:SfietKonstantin,项目名称:radeon-mesa-x86-radeon,代码行数:59,代码来源:nv10_context.c
示例2: nv20_emit_framebuffer
void
nv20_emit_framebuffer(struct gl_context *ctx, int emit)
{
struct nouveau_pushbuf *push = context_push(ctx);
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct nouveau_surface *s;
unsigned rt_format = NV20_3D_RT_FORMAT_TYPE_LINEAR;
unsigned rt_pitch = 0, zeta_pitch = 0;
unsigned bo_flags = NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR;
if (fb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT)
return;
PUSH_RESET(push, BUFCTX_FB);
/* Render target */
if (fb->_ColorDrawBuffers[0]) {
s = &to_nouveau_renderbuffer(
fb->_ColorDrawBuffers[0])->surface;
rt_format |= get_rt_format(s->format);
rt_pitch = s->pitch;
BEGIN_NV04(push, NV20_3D(COLOR_OFFSET), 1);
PUSH_MTHDl(push, NV20_3D(COLOR_OFFSET), BUFCTX_FB,
s->bo, 0, bo_flags);
}
/* depth/stencil */
if (fb->Attachment[BUFFER_DEPTH].Renderbuffer) {
s = &to_nouveau_renderbuffer(
fb->Attachment[BUFFER_DEPTH].Renderbuffer)->surface;
rt_format |= get_rt_format(s->format);
zeta_pitch = s->pitch;
BEGIN_NV04(push, NV20_3D(ZETA_OFFSET), 1);
PUSH_MTHDl(push, NV20_3D(ZETA_OFFSET), BUFCTX_FB,
s->bo, 0, bo_flags);
if (context_chipset(ctx) >= 0x25)
setup_hierz_buffer(ctx);
} else {
rt_format |= get_rt_format(MESA_FORMAT_S8_UINT_Z24_UNORM);
zeta_pitch = rt_pitch;
}
BEGIN_NV04(push, NV20_3D(RT_FORMAT), 2);
PUSH_DATA (push, rt_format);
PUSH_DATA (push, zeta_pitch << 16 | rt_pitch);
/* Recompute the viewport/scissor state. */
context_dirty(ctx, VIEWPORT);
context_dirty(ctx, SCISSOR);
context_dirty(ctx, DEPTH);
}
开发者ID:ChristophHaag,项目名称:mesa-mesa,代码行数:56,代码来源:nv20_state_fb.c
示例3: nouveau_light
static void
nouveau_light(struct gl_context *ctx, GLenum light, GLenum pname, const GLfloat *params)
{
switch (pname) {
case GL_AMBIENT:
context_dirty(ctx, MATERIAL_FRONT_AMBIENT);
context_dirty(ctx, MATERIAL_BACK_AMBIENT);
break;
case GL_DIFFUSE:
context_dirty(ctx, MATERIAL_FRONT_DIFFUSE);
context_dirty(ctx, MATERIAL_BACK_DIFFUSE);
break;
case GL_SPECULAR:
context_dirty(ctx, MATERIAL_FRONT_SPECULAR);
context_dirty(ctx, MATERIAL_BACK_SPECULAR);
break;
case GL_SPOT_CUTOFF:
case GL_POSITION:
context_dirty(ctx, MODELVIEW);
context_dirty(ctx, LIGHT_ENABLE);
context_dirty_i(ctx, LIGHT_SOURCE, light - GL_LIGHT0);
break;
default:
context_dirty_i(ctx, LIGHT_SOURCE, light - GL_LIGHT0);
break;
}
}
开发者ID:CSRedRat,项目名称:mesa-1,代码行数:27,代码来源:nouveau_state.c
示例4: nv20_emit_framebuffer
void
nv20_emit_framebuffer(GLcontext *ctx, int emit)
{
struct nouveau_channel *chan = context_chan(ctx);
struct nouveau_grobj *kelvin = context_eng3d(ctx);
struct nouveau_bo_context *bctx = context_bctx(ctx, FRAMEBUFFER);
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct nouveau_surface *s;
unsigned rt_format = NV20TCL_RT_FORMAT_TYPE_LINEAR;
unsigned rt_pitch = 0, zeta_pitch = 0;
unsigned bo_flags = NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR;
if (fb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT)
return;
/* Render target */
if (fb->_ColorDrawBuffers[0]) {
s = &to_nouveau_renderbuffer(
fb->_ColorDrawBuffers[0])->surface;
rt_format |= get_rt_format(s->format);
rt_pitch = s->pitch;
nouveau_bo_markl(bctx, kelvin, NV20TCL_COLOR_OFFSET,
s->bo, 0, bo_flags);
}
/* depth/stencil */
if (fb->_DepthBuffer) {
s = &to_nouveau_renderbuffer(
fb->_DepthBuffer->Wrapped)->surface;
rt_format |= get_rt_format(s->format);
zeta_pitch = s->pitch;
nouveau_bo_markl(bctx, kelvin, NV20TCL_ZETA_OFFSET,
s->bo, 0, bo_flags);
} else {
rt_format |= get_rt_format(MESA_FORMAT_Z24_S8);
zeta_pitch = rt_pitch;
}
BEGIN_RING(chan, kelvin, NV20TCL_RT_FORMAT, 2);
OUT_RING(chan, rt_format);
OUT_RING(chan, zeta_pitch << 16 | rt_pitch);
/* Recompute the viewport/scissor state. */
context_dirty(ctx, VIEWPORT);
context_dirty(ctx, SCISSOR);
}
开发者ID:AchironOS,项目名称:chromium.src,代码行数:50,代码来源:nv20_state_fb.c
示例5: nv04_emit_framebuffer
void
nv04_emit_framebuffer(struct gl_context *ctx, int emit)
{
struct nouveau_pushbuf *push = context_push(ctx);
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct nouveau_surface *s;
uint32_t rt_format = NV04_CONTEXT_SURFACES_3D_FORMAT_TYPE_PITCH;
uint32_t rt_pitch = 0, zeta_pitch = 0;
unsigned bo_flags = NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR;
if (fb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT)
return;
PUSH_RESET(push, BUFCTX_FB);
/* Render target */
if (fb->_ColorDrawBuffers[0]) {
s = &to_nouveau_renderbuffer(
fb->_ColorDrawBuffers[0])->surface;
rt_format |= get_rt_format(s->format);
zeta_pitch = rt_pitch = s->pitch;
BEGIN_NV04(push, NV04_SF3D(OFFSET_COLOR), 1);
PUSH_MTHDl(push, NV04_SF3D(OFFSET_COLOR), BUFCTX_FB,
s->bo, 0, bo_flags);
}
/* depth/stencil */
if (fb->Attachment[BUFFER_DEPTH].Renderbuffer) {
s = &to_nouveau_renderbuffer(
fb->Attachment[BUFFER_DEPTH].Renderbuffer)->surface;
zeta_pitch = s->pitch;
BEGIN_NV04(push, NV04_SF3D(OFFSET_ZETA), 1);
PUSH_MTHDl(push, NV04_SF3D(OFFSET_ZETA), BUFCTX_FB,
s->bo, 0, bo_flags);
}
BEGIN_NV04(push, NV04_SF3D(FORMAT), 1);
PUSH_DATA (push, rt_format);
BEGIN_NV04(push, NV04_SF3D(PITCH), 1);
PUSH_DATA (push, zeta_pitch << 16 | rt_pitch);
/* Recompute the scissor state. */
context_dirty(ctx, SCISSOR);
context_dirty(ctx, CONTROL);
}
开发者ID:ChristophHaag,项目名称:mesa-mesa,代码行数:49,代码来源:nv04_state_fb.c
示例6: nv17_zclear
static void
nv17_zclear(struct gl_context *ctx, GLbitfield *buffers)
{
struct nouveau_context *nctx = to_nouveau_context(ctx);
struct nouveau_pushbuf *push = context_push(ctx);
struct nouveau_framebuffer *nfb = to_nouveau_framebuffer(
ctx->DrawBuffer);
struct nouveau_surface *s = &to_nouveau_renderbuffer(
nfb->base.Attachment[BUFFER_DEPTH].Renderbuffer)->surface;
/* Clear the hierarchical depth buffer */
BEGIN_NV04(push, NV17_3D(HIERZ_FILL_VALUE), 1);
PUSH_DATA (push, pack_zs_f(s->format, ctx->Depth.Clear, 0));
BEGIN_NV04(push, NV17_3D(HIERZ_BUFFER_CLEAR), 1);
PUSH_DATA (push, 1);
/* Mark the depth buffer as cleared */
if (use_fast_zclear(ctx, *buffers)) {
if (nctx->hierz.clear_seq)
*buffers &= ~BUFFER_BIT_DEPTH;
nfb->hierz.clear_value =
pack_zs_f(s->format, ctx->Depth.Clear, 0);
nctx->hierz.clear_seq++;
context_dirty(ctx, ZCLEAR);
}
}
开发者ID:SfietKonstantin,项目名称:radeon-mesa-x86-radeon,代码行数:28,代码来源:nv10_context.c
示例7: nouveau_bind_framebuffer
static void
nouveau_bind_framebuffer(struct gl_context *ctx, GLenum target,
struct gl_framebuffer *dfb,
struct gl_framebuffer *rfb)
{
context_dirty(ctx, FRAMEBUFFER);
}
开发者ID:mlankhorst,项目名称:Mesa-3D,代码行数:7,代码来源:nouveau_fbo.c
示例8: nouveau_render_texture
static void
nouveau_render_texture(struct gl_context *ctx, struct gl_framebuffer *fb,
struct gl_renderbuffer_attachment *att)
{
struct gl_renderbuffer *rb = att->Renderbuffer;
struct gl_texture_image *ti =
att->Texture->Image[att->CubeMapFace][att->TextureLevel];
/* Allocate a renderbuffer object for the texture if we
* haven't already done so. */
if (!rb) {
rb = nouveau_renderbuffer_new(ctx, ~0);
assert(rb);
rb->AllocStorage = NULL;
_mesa_reference_renderbuffer(&att->Renderbuffer, rb);
}
/* Update the renderbuffer fields from the texture. */
set_renderbuffer_format(rb, get_tex_format(ti));
rb->Width = ti->Width;
rb->Height = ti->Height;
nouveau_surface_ref(&to_nouveau_teximage(ti)->surface,
&to_nouveau_renderbuffer(rb)->surface);
context_dirty(ctx, FRAMEBUFFER);
}
开发者ID:mlankhorst,项目名称:Mesa-3D,代码行数:27,代码来源:nouveau_fbo.c
示例9: nv10_emit_viewport
void
nv10_emit_viewport(struct gl_context *ctx, int emit)
{
struct nouveau_channel *chan = context_chan(ctx);
struct nouveau_grobj *celsius = context_eng3d(ctx);
struct gl_viewport_attrib *vp = &ctx->Viewport;
struct gl_framebuffer *fb = ctx->DrawBuffer;
float a[4] = {};
get_viewport_translate(ctx, a);
a[0] -= 2048;
a[1] -= 2048;
if (nv10_use_viewport_zclear(ctx))
a[2] = nv10_transform_depth(ctx, (vp->Far + vp->Near) / 2);
BEGIN_RING(chan, celsius, NV10_3D_VIEWPORT_TRANSLATE_X, 4);
OUT_RINGp(chan, a, 4);
BEGIN_RING(chan, celsius, NV10_3D_VIEWPORT_CLIP_HORIZ(0), 1);
OUT_RING(chan, (fb->Width - 1) << 16 | 0x08000800);
BEGIN_RING(chan, celsius, NV10_3D_VIEWPORT_CLIP_VERT(0), 1);
OUT_RING(chan, (fb->Height - 1) << 16 | 0x08000800);
context_dirty(ctx, PROJECTION);
}
开发者ID:ChillyWillyGuru,项目名称:RSXGL,代码行数:25,代码来源:nv10_state_fb.c
示例10: nv17_zclear
static void
nv17_zclear(struct gl_context *ctx, GLbitfield *buffers)
{
struct nouveau_context *nctx = to_nouveau_context(ctx);
struct nouveau_channel *chan = context_chan(ctx);
struct nouveau_grobj *celsius = context_eng3d(ctx);
struct nouveau_framebuffer *nfb = to_nouveau_framebuffer(
ctx->DrawBuffer);
struct nouveau_surface *s = &to_nouveau_renderbuffer(
nfb->base.Attachment[BUFFER_DEPTH].Renderbuffer)->surface;
/* Clear the hierarchical depth buffer */
BEGIN_RING(chan, celsius, NV17_3D_HIERZ_FILL_VALUE, 1);
OUT_RING(chan, pack_zs_f(s->format, ctx->Depth.Clear, 0));
BEGIN_RING(chan, celsius, NV17_3D_HIERZ_BUFFER_CLEAR, 1);
OUT_RING(chan, 1);
/* Mark the depth buffer as cleared */
if (use_fast_zclear(ctx, *buffers)) {
if (nctx->hierz.clear_seq)
*buffers &= ~BUFFER_BIT_DEPTH;
nfb->hierz.clear_value =
pack_zs_f(s->format, ctx->Depth.Clear, 0);
nctx->hierz.clear_seq++;
context_dirty(ctx, ZCLEAR);
}
}
开发者ID:ChillyWillyGuru,项目名称:RSXGL,代码行数:29,代码来源:nv10_context.c
示例11: nouveau_framebuffer_renderbuffer
static void
nouveau_framebuffer_renderbuffer(struct gl_context *ctx, struct gl_framebuffer *fb,
GLenum attachment, struct gl_renderbuffer *rb)
{
_mesa_framebuffer_renderbuffer(ctx, fb, attachment, rb);
context_dirty(ctx, FRAMEBUFFER);
}
开发者ID:mlankhorst,项目名称:Mesa-3D,代码行数:8,代码来源:nouveau_fbo.c
示例12: nv04_emit_scissor
void
nv04_emit_scissor(GLcontext *ctx, int emit)
{
struct nouveau_channel *chan = context_chan(ctx);
struct nouveau_hw_state *hw = &to_nouveau_context(ctx)->hw;
struct nouveau_grobj *surf3d = hw->surf3d;
int x, y, w, h;
get_scissors(ctx->DrawBuffer, &x, &y, &w, &h);
BEGIN_RING(chan, surf3d, NV04_CONTEXT_SURFACES_3D_CLIP_HORIZONTAL, 2);
OUT_RING(chan, w << 16 | x);
OUT_RING(chan, h << 16 | y);
/* Messing with surf3d invalidates some engine state. */
context_dirty(ctx, CONTROL);
context_dirty(ctx, BLEND);
}
开发者ID:CPFDSoftware-Tony,项目名称:gmv,代码行数:18,代码来源:nv04_state_fb.c
示例13: nouveau_update_state
static void
nouveau_update_state(struct gl_context *ctx, GLbitfield new_state)
{
int i;
if (new_state & (_NEW_PROJECTION | _NEW_MODELVIEW))
context_dirty(ctx, PROJECTION);
if (new_state & _NEW_MODELVIEW)
context_dirty(ctx, MODELVIEW);
if (new_state & _NEW_TEXTURE_MATRIX) {
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++)
context_dirty_i(ctx, TEX_MAT, i);
}
if (new_state & _NEW_CURRENT_ATTRIB &&
new_state & _NEW_LIGHT) {
context_dirty(ctx, MATERIAL_FRONT_AMBIENT);
context_dirty(ctx, MATERIAL_BACK_AMBIENT);
context_dirty(ctx, MATERIAL_FRONT_DIFFUSE);
context_dirty(ctx, MATERIAL_BACK_DIFFUSE);
context_dirty(ctx, MATERIAL_FRONT_SPECULAR);
context_dirty(ctx, MATERIAL_BACK_SPECULAR);
context_dirty(ctx, MATERIAL_FRONT_SHININESS);
context_dirty(ctx, MATERIAL_BACK_SHININESS);
}
if (new_state & _NEW_TEXTURE) {
for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
if (ctx->Texture.Unit[i].Sampler)
context_dirty_i(ctx, TEX_OBJ, i);
}
}
_swrast_InvalidateState(ctx, new_state);
_tnl_InvalidateState(ctx, new_state);
nouveau_state_emit(ctx);
}
开发者ID:CSRedRat,项目名称:mesa-1,代码行数:40,代码来源:nouveau_state.c
示例14: nv04_emit_tex_env
void
nv04_emit_tex_env(struct gl_context *ctx, int emit)
{
const int i = emit - NOUVEAU_STATE_TEX_ENV0;
struct nouveau_channel *chan = context_chan(ctx);
struct nouveau_grobj *fahrenheit = nv04_context_engine(ctx);
struct combiner_state rc_a = {}, rc_c = {};
if (!nv04_mtex_engine(fahrenheit)) {
context_dirty(ctx, BLEND);
return;
}
/* Compute the new combiner state. */
if (ctx->Texture.Unit[i]._ReallyEnabled) {
INIT_COMBINER(A, ctx, &rc_a, i);
setup_combiner(&rc_a);
INIT_COMBINER(RGB, ctx, &rc_c, i);
setup_combiner(&rc_c);
} else {
if (i == 0) {
INPUT_SRC(&rc_a, 0, PRIMARY_COLOR, 0);
INPUT_SRC(&rc_c, 0, PRIMARY_COLOR, 0);
} else {
INPUT_SRC(&rc_a, 0, PREVIOUS, 0);
INPUT_SRC(&rc_c, 0, PREVIOUS, 0);
}
INPUT_SRC(&rc_a, 1, ZERO, INVERT);
INPUT_SRC(&rc_c, 1, ZERO, INVERT);
INPUT_SRC(&rc_a, 2, ZERO, 0);
INPUT_SRC(&rc_c, 2, ZERO, 0);
INPUT_SRC(&rc_a, 3, ZERO, 0);
INPUT_SRC(&rc_c, 3, ZERO, 0);
UNSIGNED_OP(&rc_a);
UNSIGNED_OP(&rc_c);
}
/* Write the register combiner state out to the hardware. */
BEGIN_RING(chan, fahrenheit,
NV04_MULTITEX_TRIANGLE_COMBINE_ALPHA(i), 2);
OUT_RING(chan, rc_a.hw);
OUT_RING(chan, rc_c.hw);
BEGIN_RING(chan, fahrenheit,
NV04_MULTITEX_TRIANGLE_COMBINE_FACTOR, 1);
OUT_RING(chan, pack_rgba_f(MESA_FORMAT_ARGB8888,
ctx->Texture.Unit[0].EnvColor));
}
开发者ID:nikai3d,项目名称:mesa,代码行数:52,代码来源:nv04_state_frag.c
示例15: nouveau_color_material
static void
nouveau_color_material(struct gl_context *ctx, GLenum face, GLenum mode)
{
context_dirty(ctx, COLOR_MATERIAL);
context_dirty(ctx, MATERIAL_FRONT_AMBIENT);
context_dirty(ctx, MATERIAL_BACK_AMBIENT);
context_dirty(ctx, MATERIAL_FRONT_DIFFUSE);
context_dirty(ctx, MATERIAL_BACK_DIFFUSE);
context_dirty(ctx, MATERIAL_FRONT_SPECULAR);
context_dirty(ctx, MATERIAL_BACK_SPECULAR);
}
开发者ID:CSRedRat,项目名称:mesa-1,代码行数:11,代码来源:nouveau_state.c
示例16: nouveau_render_texture
static void
nouveau_render_texture(struct gl_context *ctx, struct gl_framebuffer *fb,
struct gl_renderbuffer_attachment *att)
{
struct gl_renderbuffer *rb = att->Renderbuffer;
struct gl_texture_image *ti = rb->TexImage;
/* Update the renderbuffer fields from the texture. */
nouveau_surface_ref(&to_nouveau_teximage(ti)->surface,
&to_nouveau_renderbuffer(rb)->surface);
context_dirty(ctx, FRAMEBUFFER);
}
开发者ID:Sheph,项目名称:mesa,代码行数:13,代码来源:nouveau_fbo.c
示例17: nouveau_tex_gen
static void
nouveau_tex_gen(struct gl_context *ctx, GLenum coord, GLenum pname,
const GLfloat *params)
{
switch (pname) {
case GL_TEXTURE_GEN_MODE:
context_dirty_i(ctx, TEX_GEN, ctx->Texture.CurrentUnit);
context_dirty(ctx, MODELVIEW);
break;
default:
context_dirty_i(ctx, TEX_GEN, ctx->Texture.CurrentUnit);
break;
}
}
开发者ID:CSRedRat,项目名称:mesa-1,代码行数:14,代码来源:nouveau_state.c
示例18: nv04_emit_framebuffer
void
nv04_emit_framebuffer(GLcontext *ctx, int emit)
{
struct nouveau_channel *chan = context_chan(ctx);
struct nouveau_hw_state *hw = &to_nouveau_context(ctx)->hw;
struct nouveau_grobj *surf3d = hw->surf3d;
struct nouveau_bo_context *bctx = context_bctx(ctx, FRAMEBUFFER);
struct gl_framebuffer *fb = ctx->DrawBuffer;
struct nouveau_surface *s;
uint32_t rt_format = NV04_CONTEXT_SURFACES_3D_FORMAT_TYPE_PITCH;
uint32_t rt_pitch = 0, zeta_pitch = 0;
unsigned bo_flags = NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR;
if (fb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT)
return;
/* Render target */
if (fb->_NumColorDrawBuffers) {
s = &to_nouveau_renderbuffer(
fb->_ColorDrawBuffers[0])->surface;
rt_format |= get_rt_format(s->format);
zeta_pitch = rt_pitch = s->pitch;
nouveau_bo_markl(bctx, surf3d,
NV04_CONTEXT_SURFACES_3D_OFFSET_COLOR,
s->bo, 0, bo_flags);
}
/* depth/stencil */
if (fb->_DepthBuffer) {
s = &to_nouveau_renderbuffer(
fb->_DepthBuffer->Wrapped)->surface;
zeta_pitch = s->pitch;
nouveau_bo_markl(bctx, surf3d,
NV04_CONTEXT_SURFACES_3D_OFFSET_ZETA,
s->bo, 0, bo_flags);
}
BEGIN_RING(chan, surf3d, NV04_CONTEXT_SURFACES_3D_FORMAT, 1);
OUT_RING(chan, rt_format);
BEGIN_RING(chan, surf3d, NV04_CONTEXT_SURFACES_3D_PITCH, 1);
OUT_RING(chan, zeta_pitch << 16 | rt_pitch);
/* Recompute the scissor state. */
context_dirty(ctx, SCISSOR);
}
开发者ID:CPFDSoftware-Tony,项目名称:gmv,代码行数:49,代码来源:nv04_state_fb.c
示例19: nouveau_renderbuffer_storage
static GLboolean
nouveau_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
GLenum internalFormat,
GLuint width, GLuint height)
{
struct nouveau_surface *s = &to_nouveau_renderbuffer(rb)->surface;
if (!set_renderbuffer_format(rb, internalFormat))
return GL_FALSE;
rb->Width = width;
rb->Height = height;
nouveau_surface_alloc(ctx, s, TILED, NOUVEAU_BO_VRAM | NOUVEAU_BO_MAP,
rb->Format, width, height);
context_dirty(ctx, FRAMEBUFFER);
return GL_TRUE;
}
开发者ID:mlankhorst,项目名称:Mesa-3D,代码行数:19,代码来源:nouveau_fbo.c
示例20: nv20_emit_viewport
void
nv20_emit_viewport(struct gl_context *ctx, int emit)
{
struct nouveau_pushbuf *push = context_push(ctx);
struct gl_framebuffer *fb = ctx->DrawBuffer;
float a[4] = {};
get_viewport_translate(ctx, a);
BEGIN_NV04(push, NV20_3D(VIEWPORT_TRANSLATE_X), 4);
PUSH_DATAp(push, a, 4);
BEGIN_NV04(push, NV20_3D(VIEWPORT_CLIP_HORIZ(0)), 1);
PUSH_DATA (push, (fb->Width - 1) << 16);
BEGIN_NV04(push, NV20_3D(VIEWPORT_CLIP_VERT(0)), 1);
PUSH_DATA (push, (fb->Height - 1) << 16);
context_dirty(ctx, PROJECTION);
}
开发者ID:ChristophHaag,项目名称:mesa-mesa,代码行数:19,代码来源:nv20_state_fb.c
注:本文中的context_dirty函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论