本文整理汇总了C++中softpipe_context函数的典型用法代码示例。如果您正苦于以下问题:C++ softpipe_context函数的具体用法?C++ softpipe_context怎么用?C++ softpipe_context使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了softpipe_context函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: softpipe_clear
/**
* Clear the given buffers to the specified values.
* No masking, no scissor (clear entire buffer).
*/
void
softpipe_clear(struct pipe_context *pipe, unsigned buffers,
const union pipe_color_union *color,
double depth, unsigned stencil)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
uint64_t cv;
uint i;
if (softpipe->no_rast)
return;
if (!softpipe_check_render_cond(softpipe))
return;
#if 0
softpipe_update_derived(softpipe, PIPE_PRIM_TRIANGLES); /* not needed?? */
#endif
if (buffers & PIPE_CLEAR_COLOR) {
for (i = 0; i < softpipe->framebuffer.nr_cbufs; i++) {
sp_tile_cache_clear(softpipe->cbuf_cache[i], color, 0);
}
}
if (buffers & PIPE_CLEAR_DEPTHSTENCIL) {
static const union pipe_color_union zero;
struct pipe_surface *ps = softpipe->framebuffer.zsbuf;
cv = util_pack64_z_stencil(ps->format, depth, stencil);
sp_tile_cache_clear(softpipe->zsbuf_cache, &zero, cv);
}
softpipe->dirty_render_cache = TRUE;
}
示例2: softpipe_set_vertex_sampler_textures
void
softpipe_set_vertex_sampler_textures(struct pipe_context *pipe,
unsigned num_textures,
struct pipe_texture **textures)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
uint i;
assert(num_textures <= PIPE_MAX_VERTEX_SAMPLERS);
/* Check for no-op */
if (num_textures == softpipe->num_vertex_textures &&
!memcmp(softpipe->vertex_textures, textures, num_textures * sizeof(struct pipe_texture *))) {
return;
}
draw_flush(softpipe->draw);
for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
struct pipe_texture *tex = i < num_textures ? textures[i] : NULL;
pipe_texture_reference(&softpipe->vertex_textures[i], tex);
sp_tex_tile_cache_set_texture(softpipe->vertex_tex_cache[i], tex);
}
softpipe->num_vertex_textures = num_textures;
softpipe->dirty |= SP_NEW_TEXTURE;
}
示例3: softpipe_bind_vertex_sampler_states
void
softpipe_bind_vertex_sampler_states(struct pipe_context *pipe,
unsigned num_samplers,
void **samplers)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
unsigned i;
assert(num_samplers <= PIPE_MAX_VERTEX_SAMPLERS);
/* Check for no-op */
if (num_samplers == softpipe->num_vertex_samplers &&
!memcmp(softpipe->vertex_samplers, samplers, num_samplers * sizeof(void *)))
return;
draw_flush(softpipe->draw);
for (i = 0; i < num_samplers; ++i)
softpipe->vertex_samplers[i] = samplers[i];
for (i = num_samplers; i < PIPE_MAX_VERTEX_SAMPLERS; ++i)
softpipe->vertex_samplers[i] = NULL;
softpipe->num_vertex_samplers = num_samplers;
softpipe->dirty |= SP_NEW_SAMPLER;
}
示例4: softpipe_destroy
static void
softpipe_destroy( struct pipe_context *pipe )
{
struct softpipe_context *softpipe = softpipe_context( pipe );
uint i, sh;
#if DO_PSTIPPLE_IN_HELPER_MODULE
if (softpipe->pstipple.sampler)
pipe->delete_sampler_state(pipe, softpipe->pstipple.sampler);
pipe_resource_reference(&softpipe->pstipple.texture, NULL);
pipe_sampler_view_reference(&softpipe->pstipple.sampler_view, NULL);
#endif
if (softpipe->draw)
draw_destroy( softpipe->draw );
if (softpipe->quad.shade)
softpipe->quad.shade->destroy( softpipe->quad.shade );
if (softpipe->quad.depth_test)
softpipe->quad.depth_test->destroy( softpipe->quad.depth_test );
if (softpipe->quad.blend)
softpipe->quad.blend->destroy( softpipe->quad.blend );
if (softpipe->quad.pstipple)
softpipe->quad.pstipple->destroy( softpipe->quad.pstipple );
for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
sp_destroy_tile_cache(softpipe->cbuf_cache[i]);
pipe_surface_reference(&softpipe->framebuffer.cbufs[i], NULL);
}
sp_destroy_tile_cache(softpipe->zsbuf_cache);
pipe_surface_reference(&softpipe->framebuffer.zsbuf, NULL);
for (sh = 0; sh < Elements(softpipe->tex_cache); sh++) {
for (i = 0; i < Elements(softpipe->tex_cache[0]); i++) {
sp_destroy_tex_tile_cache(softpipe->tex_cache[sh][i]);
pipe_sampler_view_reference(&softpipe->sampler_views[sh][i], NULL);
}
}
for (sh = 0; sh < Elements(softpipe->constants); sh++) {
for (i = 0; i < Elements(softpipe->constants[0]); i++) {
if (softpipe->constants[sh][i]) {
pipe_resource_reference(&softpipe->constants[sh][i], NULL);
}
}
}
for (i = 0; i < softpipe->num_vertex_buffers; i++) {
pipe_resource_reference(&softpipe->vertex_buffer[i].buffer, NULL);
}
tgsi_exec_machine_destroy(softpipe->fs_machine);
FREE( softpipe );
}
示例5: softpipe_begin_query
static void
softpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q)
{
struct softpipe_context *softpipe = softpipe_context( pipe );
struct softpipe_query *sq = softpipe_query(q);
switch (sq->type) {
case PIPE_QUERY_OCCLUSION_COUNTER:
sq->start = softpipe->occlusion_count;
break;
case PIPE_QUERY_TIMESTAMP_DISJOINT:
case PIPE_QUERY_TIME_ELAPSED:
sq->start = 1000*os_time_get();
break;
case PIPE_QUERY_SO_STATISTICS:
sq->so.primitives_storage_needed = 0;
case PIPE_QUERY_PRIMITIVES_EMITTED:
sq->so.num_primitives_written = 0;
softpipe->so_stats.num_primitives_written = 0;
break;
case PIPE_QUERY_PRIMITIVES_GENERATED:
sq->num_primitives_generated = 0;
softpipe->num_primitives_generated = 0;
break;
case PIPE_QUERY_TIMESTAMP:
case PIPE_QUERY_GPU_FINISHED:
break;
default:
assert(0);
break;
}
softpipe->active_query_count++;
softpipe->dirty |= SP_NEW_QUERY;
}
示例6: softpipe_end_query
static void
softpipe_end_query(struct pipe_context *pipe, struct pipe_query *q)
{
struct softpipe_context *softpipe = softpipe_context( pipe );
struct softpipe_query *sq = softpipe_query(q);
sq->end = softpipe->occlusion_count;
}
示例7: softpipe_set_clip_state
void softpipe_set_clip_state( struct pipe_context *pipe,
const struct pipe_clip_state *clip )
{
struct softpipe_context *softpipe = softpipe_context(pipe);
/* pass the clip state to the draw module */
draw_set_clip_state(softpipe->draw, clip);
}
示例8: softpipe_set_sampler_views
void
softpipe_set_sampler_views(struct pipe_context *pipe,
unsigned shader,
unsigned start,
unsigned num,
struct pipe_sampler_view **views)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
uint i;
assert(shader < PIPE_SHADER_TYPES);
assert(start + num <= ARRAY_SIZE(softpipe->sampler_views[shader]));
draw_flush(softpipe->draw);
/* set the new sampler views */
for (i = 0; i < num; i++) {
struct sp_sampler_view *sp_sviewsrc;
struct sp_sampler_view *sp_sviewdst =
&softpipe->tgsi.sampler[shader]->sp_sview[start + i];
struct pipe_sampler_view **pview = &softpipe->sampler_views[shader][start + i];
pipe_sampler_view_reference(pview, views[i]);
sp_tex_tile_cache_set_sampler_view(softpipe->tex_cache[shader][start + i],
views[i]);
/*
* We don't really have variants, however some bits are different per shader,
* so just copy?
*/
sp_sviewsrc = (struct sp_sampler_view *)*pview;
if (sp_sviewsrc) {
memcpy(sp_sviewdst, sp_sviewsrc, sizeof(*sp_sviewsrc));
sp_sviewdst->compute_lambda = softpipe_get_lambda_func(&sp_sviewdst->base, shader);
sp_sviewdst->cache = softpipe->tex_cache[shader][start + i];
}
else {
memset(sp_sviewdst, 0, sizeof(*sp_sviewsrc));
}
}
/* find highest non-null sampler_views[] entry */
{
unsigned j = MAX2(softpipe->num_sampler_views[shader], start + num);
while (j > 0 && softpipe->sampler_views[shader][j - 1] == NULL)
j--;
softpipe->num_sampler_views[shader] = j;
}
if (shader == PIPE_SHADER_VERTEX || shader == PIPE_SHADER_GEOMETRY) {
draw_set_sampler_views(softpipe->draw,
shader,
softpipe->sampler_views[shader],
softpipe->num_sampler_views[shader]);
}
softpipe->dirty |= SP_NEW_TEXTURE;
}
示例9: softpipe_set_stencil_ref
void softpipe_set_stencil_ref( struct pipe_context *pipe,
const struct pipe_stencil_ref *stencil_ref )
{
struct softpipe_context *softpipe = softpipe_context(pipe);
softpipe->stencil_ref = *stencil_ref;
softpipe->dirty |= SP_NEW_DEPTH_STENCIL_ALPHA;
}
示例10: softpipe_set_blend_color
void softpipe_set_blend_color( struct pipe_context *pipe,
const struct pipe_blend_color *blend_color )
{
struct softpipe_context *softpipe = softpipe_context(pipe);
softpipe->blend_color = *blend_color;
softpipe->dirty |= SP_NEW_BLEND;
}
示例11: softpipe_bind_blend_state
void softpipe_bind_blend_state( struct pipe_context *pipe,
void *blend )
{
struct softpipe_context *softpipe = softpipe_context(pipe);
softpipe->blend = (const struct pipe_blend_state *)blend;
softpipe->dirty |= SP_NEW_BLEND;
}
示例12: softpipe_bind_depth_stencil_state
void
softpipe_bind_depth_stencil_state(struct pipe_context *pipe,
void *depth_stencil)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
softpipe->depth_stencil = (struct pipe_depth_stencil_alpha_state *)depth_stencil;
softpipe->dirty |= SP_NEW_DEPTH_STENCIL_ALPHA;
}
示例13: softpipe_render_condition
static void
softpipe_render_condition( struct pipe_context *pipe,
struct pipe_query *query,
uint mode )
{
struct softpipe_context *softpipe = softpipe_context( pipe );
softpipe->render_cond_query = query;
softpipe->render_cond_mode = mode;
}
示例14: softpipe_set_polygon_stipple
void softpipe_set_polygon_stipple( struct pipe_context *pipe,
const struct pipe_poly_stipple *stipple )
{
struct softpipe_context *softpipe = softpipe_context(pipe);
draw_flush(softpipe->draw);
softpipe->poly_stipple = *stipple; /* struct copy */
softpipe->dirty |= SP_NEW_STIPPLE;
}
示例15: softpipe_set_scissor_state
void softpipe_set_scissor_state( struct pipe_context *pipe,
const struct pipe_scissor_state *scissor )
{
struct softpipe_context *softpipe = softpipe_context(pipe);
draw_flush(softpipe->draw);
softpipe->scissor = *scissor; /* struct copy */
softpipe->dirty |= SP_NEW_SCISSOR;
}