summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/svga/svga_state_tss.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-08-15 13:36:02 +0100
committerJosé Fonseca <jfonseca@vmware.com>2010-08-30 13:01:57 +0100
commit5a70db643295e99ca3f821a34abe474d56a6c872 (patch)
treeef8f07998eb0f67ebb98ac89992e8a0b377f23fe /src/gallium/drivers/svga/svga_state_tss.c
parent007bac83312b29061753e625edfd45ccab9ecc9c (diff)
svga: Re-emit bound rendertargets and texture samplers at the beginning of every command buffer.
Only non null resources. To ensure that relocations are emitted for every resource currently referred.
Diffstat (limited to 'src/gallium/drivers/svga/svga_state_tss.c')
-rw-r--r--src/gallium/drivers/svga/svga_state_tss.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/gallium/drivers/svga/svga_state_tss.c b/src/gallium/drivers/svga/svga_state_tss.c
index e42c4f7fce..4a50b19474 100644
--- a/src/gallium/drivers/svga/svga_state_tss.c
+++ b/src/gallium/drivers/svga/svga_state_tss.c
@@ -56,6 +56,7 @@ static int
update_tss_binding(struct svga_context *svga,
unsigned dirty )
{
+ boolean reemit = !!(dirty & SVGA_NEW_COMMAND_BUFFER);
unsigned i;
unsigned count = MAX2( svga->curr.num_sampler_views,
svga->state.hw_draw.num_views );
@@ -107,12 +108,18 @@ update_tss_binding(struct svga_context *svga,
max_lod);
}
- if (view->dirty) {
+ /*
+ * We need to reemit non-null texture bindings, even when they are not
+ * dirty, to ensure that the resources are paged in.
+ */
+
+ if (view->dirty ||
+ (reemit && view->v)) {
queue.bind[queue.bind_count].unit = i;
queue.bind[queue.bind_count].view = view;
queue.bind_count++;
}
- else if (view->v) {
+ if (!view->dirty && view->v) {
svga_validate_sampler_view(svga, view->v);
}
}
@@ -160,7 +167,8 @@ fail:
struct svga_tracked_state svga_hw_tss_binding = {
"texture binding emit",
SVGA_NEW_TEXTURE_BINDING |
- SVGA_NEW_SAMPLER,
+ SVGA_NEW_SAMPLER |
+ SVGA_NEW_COMMAND_BUFFER,
update_tss_binding
};