llvmpipe: check for texture usage in all scenes
[mesa.git] / src / mesa / drivers / dri / r600 / r600_emit.c
index f8c56e7774b3f439311c51784d8f31bc20376768..5c250c2418a6903ae86e8428bf666d182014ba67 100644 (file)
@@ -60,28 +60,30 @@ GLboolean r600EmitShader(GLcontext * ctx,
        radeonContextPtr radeonctx = RADEON_CONTEXT(ctx);
        struct radeon_bo * pbo;
        uint32_t *out;
-
 shader_again_alloc:
        pbo = radeon_bo_open(radeonctx->radeonScreen->bom,
-                            0,
-                            sizeinDWORD * 4,
-                            256,
-                            RADEON_GEM_DOMAIN_GTT,
-                            0);
+                       0,
+                       sizeinDWORD * 4,
+                       256,
+                       RADEON_GEM_DOMAIN_GTT,
+                       0);
+
+       radeon_print(RADEON_SHADER, RADEON_NORMAL, "%s %p size %d: %s\n", __func__, pbo, sizeinDWORD, szShaderUsage);
 
        if (!pbo) {
+               radeon_print(RADEON_MEMORY | RADEON_CS, RADEON_IMPORTANT, "No memory for buffer object. Flushing command buffer.\n");
                rcommonFlushCmdBuf(radeonctx, __FUNCTION__);
                goto shader_again_alloc;
        }
 
        radeon_cs_space_add_persistent_bo(radeonctx->cmdbuf.cs,
-                                         pbo,
-                                         RADEON_GEM_DOMAIN_GTT, 0);
+                       pbo,
+                       RADEON_GEM_DOMAIN_GTT, 0);
 
-        if (radeon_cs_space_check_with_bo(radeonctx->cmdbuf.cs,
-                                          pbo,
-                                          RADEON_GEM_DOMAIN_GTT, 0)) {
-                fprintf(stderr,"failure to revalidate BOs - badness\n");
+       if (radeon_cs_space_check_with_bo(radeonctx->cmdbuf.cs,
+                               pbo,
+                               RADEON_GEM_DOMAIN_GTT, 0)) {
+               radeon_error("failure to revalidate BOs - badness\n");
                return GL_FALSE;
        }
 
@@ -103,6 +105,8 @@ GLboolean r600DeleteShader(GLcontext * ctx,
 {
     struct radeon_bo * pbo = (struct radeon_bo *)shaderbo;
 
+    radeon_print(RADEON_SHADER, RADEON_NORMAL, "%s: %p\n", __func__, pbo);
+
     if (pbo) {
            if (pbo->ptr)
                radeon_bo_unmap(pbo);