From 8dfafbf0861fe3d2542332658dd5493851053c78 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 2 Nov 2010 16:29:10 +0000 Subject: st/mesa: unbind constant buffer when not in use Important as more constant buffers per shader start to get used. Fix up r600 (tested) and nv50 (untested) to cope with this. Drivers previously didn't see unbinds of constant buffers often or ever, so this isn't always dealt with cleanly. For r600 just return and keep the reference. Will try to do better in a followup change. --- src/gallium/drivers/nv50/nv50_shader_state.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/gallium/drivers/nv50/nv50_shader_state.c') diff --git a/src/gallium/drivers/nv50/nv50_shader_state.c b/src/gallium/drivers/nv50/nv50_shader_state.c index 6c41e8f4561..306aa81d985 100644 --- a/src/gallium/drivers/nv50/nv50_shader_state.c +++ b/src/gallium/drivers/nv50/nv50_shader_state.c @@ -39,6 +39,9 @@ nv50_transfer_constbuf(struct nv50_context *nv50, uint32_t *map; unsigned count, start; + if (buf == NULL) + return; + map = pipe_buffer_map(pipe, buf, PIPE_TRANSFER_READ, &transfer); if (!map) return; -- cgit v1.2.3