/**
* Called when tearing down a context to free resources and samplers.
*/
-void svga_cleanup_tss_binding(struct svga_context *svga)
+void
+svga_cleanup_tss_binding(struct svga_context *svga)
{
const enum pipe_shader_type shader = PIPE_SHADER_FRAGMENT;
unsigned i;
view->max_lod != max_lod) {
svga_sampler_view_reference(&view->v, NULL);
- pipe_resource_reference( &view->texture, texture );
+ pipe_resource_reference(&view->texture, texture);
view->dirty = TRUE;
view->min_lod = min_lod;
static enum pipe_error
-update_tss_binding(struct svga_context *svga,
- unsigned dirty )
+update_tss_binding(struct svga_context *svga, unsigned dirty)
{
const enum pipe_shader_type shader = PIPE_SHADER_FRAGMENT;
boolean reemit = svga->rebind.flags.texture_samplers;
unsigned i;
- unsigned count = MAX2( svga->curr.num_sampler_views[shader],
- svga->state.hw_draw.num_views );
+ unsigned count = MAX2(svga->curr.num_sampler_views[shader],
+ svga->state.hw_draw.num_views);
struct bind_queue queue;
return PIPE_OK;
queue.bind_count = 0;
-
+
for (i = 0; i < count; i++) {
emit_tex_binding_unit(svga, i,
svga->curr.sampler[shader][i],
if (queue.bind_count) {
SVGA3dTextureState *ts;
- if (SVGA3D_BeginSetTextureState( svga->swc,
- &ts,
- queue.bind_count ) != PIPE_OK)
+ if (SVGA3D_BeginSetTextureState(svga->swc, &ts,
+ queue.bind_count) != PIPE_OK)
goto fail;
for (i = 0; i < queue.bind_count; i++) {
NULL,
handle,
SVGA_RELOC_READ);
-
+
queue.bind[i].view->dirty = FALSE;
}
- SVGA_FIFOCommitAll( svga->swc );
+ SVGA_FIFOCommitAll(svga->swc);
}
svga->rebind.flags.texture_samplers = FALSE;
if (queue.bind_count) {
SVGA3dTextureState *ts;
- ret = SVGA3D_BeginSetTextureState(svga->swc,
- &ts,
- queue.bind_count);
+ ret = SVGA3D_BeginSetTextureState(svga->swc, &ts, queue.bind_count);
if (ret != PIPE_OK) {
return ret;
}
};
-/***********************************************************************
- */
struct ts_queue {
unsigned ts_count;
static inline void
-svga_queue_tss( struct ts_queue *q,
- unsigned unit,
- unsigned tss,
- unsigned value )
+svga_queue_tss(struct ts_queue *q, unsigned unit, unsigned tss, unsigned value)
{
assert(q->ts_count < ARRAY_SIZE(q->ts));
q->ts[q->ts_count].stage = unit;
assert(unit < ARRAY_SIZE(svga->state.hw_draw.ts)); \
STATIC_ASSERT(SVGA3D_TS_##token < ARRAY_SIZE(svga->state.hw_draw.ts[unit])); \
if (svga->state.hw_draw.ts[unit][SVGA3D_TS_##token] != val) { \
- svga_queue_tss( queue, unit, SVGA3D_TS_##token, val ); \
+ svga_queue_tss(queue, unit, SVGA3D_TS_##token, val); \
svga->state.hw_draw.ts[unit][SVGA3D_TS_##token] = val; \
} \
} while (0)
assert(unit < ARRAY_SIZE(svga->state.hw_draw.ts)); \
STATIC_ASSERT(SVGA3D_TS_##token < ARRAY_SIZE(svga->state.hw_draw.ts[unit])); \
if (svga->state.hw_draw.ts[unit][SVGA3D_TS_##token] != val) { \
- svga_queue_tss( queue, unit, SVGA3D_TS_##token, val ); \
+ svga_queue_tss(queue, unit, SVGA3D_TS_##token, val); \
svga->state.hw_draw.ts[unit][SVGA3D_TS_##token] = val; \
} \
} while (0)
}
static enum pipe_error
-update_tss(struct svga_context *svga,
- unsigned dirty )
+update_tss(struct svga_context *svga, unsigned dirty)
{
const enum pipe_shader_type shader = PIPE_SHADER_FRAGMENT;
unsigned i;
svga->polygon_stipple.sampler,
&queue);
}
-
+
if (queue.ts_count) {
SVGA3dTextureState *ts;
- if (SVGA3D_BeginSetTextureState( svga->swc,
- &ts,
- queue.ts_count ) != PIPE_OK)
+ if (SVGA3D_BeginSetTextureState(svga->swc, &ts, queue.ts_count) != PIPE_OK)
goto fail;
- memcpy( ts,
- queue.ts,
- queue.ts_count * sizeof queue.ts[0]);
-
- SVGA_FIFOCommitAll( svga->swc );
+ memcpy(ts, queue.ts, queue.ts_count * sizeof queue.ts[0]);
+
+ SVGA_FIFOCommitAll(svga->swc);
}
return PIPE_OK;