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

C++ r300_screen函数代码示例

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

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



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

示例1: r300_texture_reinterpret_format

void r300_texture_reinterpret_format(struct pipe_screen *screen,
                                     struct pipe_texture *tex,
                                     enum pipe_format new_format)
{
    struct r300_screen *r300screen = r300_screen(screen);

    SCREEN_DBG(r300screen, DBG_TEX, "r300: Reinterpreting format: %s -> %s\n",
               util_format_name(tex->format), util_format_name(new_format));

    tex->format = new_format;

    r300_setup_texture_state(r300_screen(screen), (struct r300_texture*)tex);
}
开发者ID:CPFDSoftware-Tony,项目名称:gmv,代码行数:13,代码来源:r300_texture.c


示例2: r300_create_sampler_state

static void*
        r300_create_sampler_state(struct pipe_context* pipe,
                                  const struct pipe_sampler_state* state)
{
    struct r300_context* r300 = r300_context(pipe);
    struct r300_sampler_state* sampler = CALLOC_STRUCT(r300_sampler_state);
    int lod_bias;

    sampler->filter0 |=
        (r300_translate_wrap(state->wrap_s) << R300_TX_WRAP_S_SHIFT) |
        (r300_translate_wrap(state->wrap_t) << R300_TX_WRAP_T_SHIFT) |
        (r300_translate_wrap(state->wrap_r) << R300_TX_WRAP_R_SHIFT);

    sampler->filter0 |= r300_translate_tex_filters(state->min_img_filter,
                                                   state->mag_img_filter,
                                                   state->min_mip_filter);

    lod_bias = CLAMP((int)(state->lod_bias * 32), -(1 << 9), (1 << 9) - 1);

    sampler->filter1 |= lod_bias << R300_LOD_BIAS_SHIFT;

    sampler->filter1 |= r300_anisotropy(state->max_anisotropy);

    util_pack_color(state->border_color, PIPE_FORMAT_A8R8G8B8_UNORM,
                    &sampler->border_color);

    /* R500-specific fixups and optimizations */
    if (r300_screen(r300->context.screen)->caps->is_r500) {
        sampler->filter1 |= R500_BORDER_FIX;
    }

    return (void*)sampler;
}
开发者ID:MttDs,项目名称:new-rexeno-tindpe,代码行数:33,代码来源:r300_state.c


示例3: r300_buffer_transfer_map

static void *
r300_buffer_transfer_map( struct pipe_context *pipe,
			  struct pipe_transfer *transfer )
{
    struct r300_context *r300 = r300_context(pipe);
    struct r300_screen *r300screen = r300_screen(pipe->screen);
    struct radeon_winsys *rws = r300screen->rws;
    struct r300_resource *rbuf = r300_resource(transfer->resource);
    uint8_t *map;
    enum pipe_transfer_usage usage;

    if (rbuf->b.b.user_ptr)
        return rbuf->b.b.user_ptr + transfer->box.x;
    if (rbuf->constant_buffer)
        return (uint8_t *) rbuf->constant_buffer + transfer->box.x;

    /* Buffers are never used for write, therefore mapping for read can be
     * unsynchronized. */
    usage = transfer->usage;
    if (!(usage & PIPE_TRANSFER_WRITE)) {
       usage |= PIPE_TRANSFER_UNSYNCHRONIZED;
    }

    map = rws->buffer_map(rbuf->cs_buf, r300->cs, usage);

    if (map == NULL)
        return NULL;

    return map + transfer->box.x;
}
开发者ID:Ponozhovshchina,项目名称:mesa,代码行数:30,代码来源:r300_screen_buffer.c


示例4: r300_fence_signalled

static boolean r300_fence_signalled(struct pipe_screen *screen,
                                    struct pipe_fence_handle *fence)
{
    struct radeon_winsys *rws = r300_screen(screen)->rws;

    return rws->fence_wait(rws, fence, 0);
}
开发者ID:TechnoMancer,项目名称:mesa,代码行数:7,代码来源:r300_screen.c


示例5: r300_get_paramf

static float r300_get_paramf(struct pipe_screen* pscreen, int param)
{
    struct r300_screen* r300screen = r300_screen(pscreen);

    switch (param) {
        case PIPE_CAP_MAX_LINE_WIDTH:
        case PIPE_CAP_MAX_LINE_WIDTH_AA:
        case PIPE_CAP_MAX_POINT_WIDTH:
        case PIPE_CAP_MAX_POINT_WIDTH_AA:
            /* The maximum dimensions of the colorbuffer are our practical
             * rendering limits. 2048 pixels should be enough for anybody. */
            if (r300screen->caps->is_r500) {
                return 4096.0f;
            } else if (r300screen->caps->is_r400) {
                return 4021.0f;
            } else {
                return 2560.0f;
            }
        case PIPE_CAP_MAX_TEXTURE_ANISOTROPY:
            return 16.0f;
        case PIPE_CAP_MAX_TEXTURE_LOD_BIAS:
            return 16.0f;
        default:
            debug_printf("r300: Implementation error: Bad paramf %d\n",
                param);
            return 0.0f;
    }
}
开发者ID:CPFDSoftware-Tony,项目名称:gmv,代码行数:28,代码来源:r300_screen.c


示例6: r300_destroy_screen

static void r300_destroy_screen(struct pipe_screen* pscreen)
{
    struct r300_screen* r300screen = r300_screen(pscreen);

    FREE(r300screen->caps);
    FREE(r300screen);
}
开发者ID:CPFDSoftware-Tony,项目名称:gmv,代码行数:7,代码来源:r300_screen.c


示例7: r300_screen

struct pipe_resource *r300_user_buffer_create(struct pipe_screen *screen,
					      void *ptr, unsigned size,
					      unsigned bind)
{
    struct r300_screen *r300screen = r300_screen(screen);
    struct r300_resource *rbuf;

    rbuf = util_slab_alloc(&r300screen->pool_buffers);

    pipe_reference_init(&rbuf->b.b.reference, 1);
    rbuf->b.b.screen = screen;
    rbuf->b.b.target = PIPE_BUFFER;
    rbuf->b.b.format = PIPE_FORMAT_R8_UNORM;
    rbuf->b.b.usage = PIPE_USAGE_IMMUTABLE;
    rbuf->b.b.bind = bind;
    rbuf->b.b.width0 = ~0;
    rbuf->b.b.height0 = 1;
    rbuf->b.b.depth0 = 1;
    rbuf->b.b.array_size = 1;
    rbuf->b.b.flags = 0;
    rbuf->b.b.user_ptr = ptr;
    rbuf->b.vtbl = &r300_buffer_vtbl;
    rbuf->domain = RADEON_DOMAIN_GTT;
    rbuf->buf = NULL;
    rbuf->constant_buffer = NULL;
    return &rbuf->b.b;
}
开发者ID:Ponozhovshchina,项目名称:mesa,代码行数:27,代码来源:r300_screen_buffer.c


示例8: r300_fence_finish

static boolean r300_fence_finish(struct pipe_screen *screen,
                                 struct pipe_fence_handle *fence,
                                 uint64_t timeout)
{
    struct radeon_winsys *rws = r300_screen(screen)->rws;
    struct pb_buffer *rfence = (struct pb_buffer*)fence;

    if (timeout != PIPE_TIMEOUT_INFINITE) {
        int64_t start_time = os_time_get();

        /* Convert to microseconds. */
        timeout /= 1000;

        /* Wait in a loop. */
        while (rws->buffer_is_busy(rfence, RADEON_USAGE_READWRITE)) {
            if (os_time_get() - start_time >= timeout) {
                return FALSE;
            }
            os_time_sleep(10);
        }
        return TRUE;
    }

    rws->buffer_wait(rfence, RADEON_USAGE_READWRITE);
    return TRUE;
}
开发者ID:mlankhorst,项目名称:Mesa-3D,代码行数:26,代码来源:r300_screen.c


示例9: r300_get_paramf

static float r300_get_paramf(struct pipe_screen* pscreen,
                             enum pipe_capf param)
{
    struct r300_screen* r300screen = r300_screen(pscreen);

    switch (param) {
        case PIPE_CAPF_MAX_LINE_WIDTH:
        case PIPE_CAPF_MAX_LINE_WIDTH_AA:
        case PIPE_CAPF_MAX_POINT_WIDTH:
        case PIPE_CAPF_MAX_POINT_WIDTH_AA:
            /* The maximum dimensions of the colorbuffer are our practical
             * rendering limits. 2048 pixels should be enough for anybody. */
            if (r300screen->caps.is_r500) {
                return 4096.0f;
            } else if (r300screen->caps.is_r400) {
                return 4021.0f;
            } else {
                return 2560.0f;
            }
        case PIPE_CAPF_MAX_TEXTURE_ANISOTROPY:
            return 16.0f;
        case PIPE_CAPF_MAX_TEXTURE_LOD_BIAS:
            return 16.0f;
        case PIPE_CAPF_GUARD_BAND_LEFT:
        case PIPE_CAPF_GUARD_BAND_TOP:
        case PIPE_CAPF_GUARD_BAND_RIGHT:
        case PIPE_CAPF_GUARD_BAND_BOTTOM:
            return 0.0f;
        default:
            debug_printf("r300: Warning: Unknown CAP %d in get_paramf.\n",
                         param);
            return 0.0f;
    }
}
开发者ID:elgambitero,项目名称:Mesa-3D,代码行数:34,代码来源:r300_screen.c


示例10: r300_get_tex_transfer

static struct pipe_transfer*
r300_get_tex_transfer(struct pipe_screen *screen,
                      struct pipe_texture *texture,
                      unsigned face, unsigned level, unsigned zslice,
                      enum pipe_transfer_usage usage, unsigned x, unsigned y,
                      unsigned w, unsigned h)
{
    struct r300_texture *tex = (struct r300_texture *)texture;
    struct r300_transfer *trans;
    struct r300_screen *rscreen = r300_screen(screen);
    unsigned offset;

    offset = r300_texture_get_offset(tex, level, zslice, face);  /* in bytes */

    trans = CALLOC_STRUCT(r300_transfer);
    if (trans) {
        pipe_texture_reference(&trans->transfer.texture, texture);
        trans->transfer.x = x;
        trans->transfer.y = y;
        trans->transfer.width = w;
        trans->transfer.height = h;
        trans->transfer.stride = r300_texture_get_stride(rscreen, tex, level);
        trans->transfer.usage = usage;
        trans->transfer.zslice = zslice;
        trans->transfer.face = face;

        trans->offset = offset;
    }
    return &trans->transfer;
}
开发者ID:CPFDSoftware-Tony,项目名称:gmv,代码行数:30,代码来源:r300_screen.c


示例11: r300_fence_finish

static boolean r300_fence_finish(struct pipe_screen *screen,
                                 struct pipe_fence_handle *fence,
                                 uint64_t timeout)
{
    struct radeon_winsys *rws = r300_screen(screen)->rws;

    return rws->fence_wait(rws, fence, timeout);
}
开发者ID:TechnoMancer,项目名称:mesa,代码行数:8,代码来源:r300_screen.c


示例12: r300_fence_reference

static void r300_fence_reference(struct pipe_screen *screen,
                                 struct pipe_fence_handle **ptr,
                                 struct pipe_fence_handle *fence)
{
    struct radeon_winsys *rws = r300_screen(screen)->rws;

    rws->fence_reference(ptr, fence);
}
开发者ID:TechnoMancer,项目名称:mesa,代码行数:8,代码来源:r300_screen.c


示例13: r300_fence_signalled

static boolean r300_fence_signalled(struct pipe_screen *screen,
                                    struct pipe_fence_handle *fence)
{
    struct radeon_winsys *rws = r300_screen(screen)->rws;
    struct pb_buffer *rfence = (struct pb_buffer*)fence;

    return !rws->buffer_is_busy(rfence, RADEON_USAGE_READWRITE);
}
开发者ID:mlankhorst,项目名称:Mesa-3D,代码行数:8,代码来源:r300_screen.c


示例14: r300_destroy_screen

static void r300_destroy_screen(struct pipe_screen* pscreen)
{
    struct r300_screen* r300screen = r300_screen(pscreen);
    struct radeon_winsys *rws = radeon_winsys(pscreen);

    if (rws)
      rws->destroy(rws);

    FREE(r300screen);
}
开发者ID:anupamkaul,项目名称:mesa,代码行数:10,代码来源:r300_screen.c


示例15: r300_set_clip_state

static void r300_set_clip_state(struct pipe_context* pipe,
                                const struct pipe_clip_state* state)
{
    struct r300_context* r300 = r300_context(pipe);

    if (r300_screen(pipe->screen)->caps->has_tcl) {
        r300->clip_state = *state;
        r300->dirty_state |= R300_NEW_CLIP;
    } else {
        draw_flush(r300->draw);
        draw_set_clip_state(r300->draw, state);
    }
}
开发者ID:MttDs,项目名称:new-rexeno-tindpe,代码行数:13,代码来源:r300_state.c


示例16: r300_destroy_screen

static void r300_destroy_screen(struct pipe_screen* pscreen)
{
    struct r300_screen* r300screen = r300_screen(pscreen);
    struct radeon_winsys *rws = radeon_winsys(pscreen);

    util_slab_destroy(&r300screen->pool_buffers);
    pipe_mutex_destroy(r300screen->num_contexts_mutex);

    if (rws)
      rws->destroy(rws);

    FREE(r300screen);
}
开发者ID:mlankhorst,项目名称:Mesa-3D,代码行数:13,代码来源:r300_screen.c


示例17: r300_buffer_destroy

static void r300_buffer_destroy(struct pipe_screen *screen,
				struct pipe_resource *buf)
{
    struct r300_screen *r300screen = r300_screen(screen);
    struct r300_resource *rbuf = r300_resource(buf);

    if (rbuf->constant_buffer)
        FREE(rbuf->constant_buffer);

    if (rbuf->buf)
        pb_reference(&rbuf->buf, NULL);

    util_slab_free(&r300screen->pool_buffers, rbuf);
}
开发者ID:Ponozhovshchina,项目名称:mesa,代码行数:14,代码来源:r300_screen_buffer.c


示例18: r300_destroy_screen

static void r300_destroy_screen(struct pipe_screen* pscreen)
{
    struct r300_screen* r300screen = r300_screen(pscreen);
    struct radeon_winsys *rws = radeon_winsys(pscreen);

    if (rws && !rws->unref(rws))
      return;

    pipe_mutex_destroy(r300screen->cmask_mutex);

    if (rws)
      rws->destroy(rws);

    FREE(r300screen);
}
开发者ID:TechnoMancer,项目名称:mesa,代码行数:15,代码来源:r300_screen.c


示例19: r300_delete_vs_state

static void r300_delete_vs_state(struct pipe_context* pipe, void* shader)
{
    struct r300_context* r300 = r300_context(pipe);

    if (r300_screen(pipe->screen)->caps->has_tcl) {
        struct r300_vertex_shader* vs = (struct r300_vertex_shader*)shader;

        rc_constants_destroy(&vs->code.constants);
        draw_delete_vertex_shader(r300->draw, vs->draw);
        FREE((void*)vs->state.tokens);
        FREE(shader);
    } else {
        draw_delete_vertex_shader(r300->draw,
                (struct draw_vertex_shader*)shader);
    }
}
开发者ID:MttDs,项目名称:new-rexeno-tindpe,代码行数:16,代码来源:r300_state.c


示例20: r300_translate_fragment_shader

void r300_translate_fragment_shader(struct r300_context* r300,
                                    struct r300_fragment_shader* fs)
{
    struct r300_fragment_program_compiler compiler;
    struct tgsi_to_rc ttr;

    memset(&compiler, 0, sizeof(compiler));
    rc_init(&compiler.Base);
    compiler.Base.Debug = DBG_ON(r300, DBG_FP);

    compiler.code = &fs->code;
    compiler.is_r500 = r300_screen(r300->context.screen)->caps->is_r500;
    compiler.AllocateHwInputs = &allocate_hardware_inputs;
    compiler.UserData = fs;

    /* TODO: Program compilation depends on texture compare modes,
     * which are sampler state. Therefore, programs need to be recompiled
     * depending on this state as in the classic Mesa driver.
     *
     * This is not yet handled correctly.
     */

    find_output_registers(&compiler, fs);

    if (compiler.Base.Debug) {
        debug_printf("r300: Initial fragment program\n");
        tgsi_dump(fs->state.tokens, 0);
    }

    /* Translate TGSI to our internal representation */
    ttr.compiler = &compiler.Base;
    ttr.info = &fs->info;

    r300_tgsi_to_rc(&ttr, fs->state.tokens);

    /* Invoke the compiler */
    r3xx_compile_fragment_program(&compiler);
    if (compiler.Base.Error) {
        /* XXX failover maybe? */
        DBG(r300, DBG_FP, "r300: Error compiling fragment program: %s\n",
            compiler.Base.ErrorMsg);
    }

    /* And, finally... */
    rc_destroy(&compiler.Base);
    fs->translated = TRUE;
}
开发者ID:MttDs,项目名称:new-rexeno-tindpe,代码行数:47,代码来源:r300_fs.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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