#include "util/u_transfer.h"
+#include "nouveau/nouveau_winsys.h"
+
struct pipe_resource;
struct nouveau_bo;
return (struct nv50_resource *)resource;
}
+/* is resource mapped into the GPU's address space (i.e. VRAM or GART) ? */
+static INLINE boolean
+nv50_resource_mapped_by_gpu(struct pipe_resource *resource)
+{
+ return nv50_resource(resource)->bo->handle;
+}
void
nv50_init_resource_functions(struct pipe_context *pcontext);
BEGIN_RING(chan, tesla, NV50TCL_VB_ELEMENT_BASE, 1);
OUT_RING (chan, indexBias);
- if (!(indexBuffer->bind & PIPE_BIND_INDEX_BUFFER) || indexSize == 1) {
+ if (!nv50_resource_mapped_by_gpu(indexBuffer) || indexSize == 1) {
nv50_draw_elements_inline(pipe, indexBuffer, indexSize,
mode, start, count, startInstance,
instanceCount);
for (i = 0; i < nv50->vtxbuf_nr; i++) {
if (nv50->vtxbuf[i].stride &&
- !(nv50->vtxbuf[i].buffer->bind & PIPE_BIND_VERTEX_BUFFER))
+ !nv50_resource_mapped_by_gpu(nv50->vtxbuf[i].buffer))
nv50->vbo_fifo = 0xffff;
}