summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r600/r600_emit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/r600/r600_emit.c')
-rw-r--r--src/mesa/drivers/dri/r600/r600_emit.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/r600/r600_emit.c b/src/mesa/drivers/dri/r600/r600_emit.c
index fc8f987cab..dee4cd3435 100644
--- a/src/mesa/drivers/dri/r600/r600_emit.c
+++ b/src/mesa/drivers/dri/r600/r600_emit.c
@@ -175,7 +175,8 @@ void r600EmitCacheFlush(r600ContextPtr rmesa)
GLboolean r600EmitShader(GLcontext * ctx,
void ** shaderbo,
GLvoid * data,
- int sizeinDWORD)
+ int sizeinDWORD,
+ char * szShaderUsage)
{
radeonContextPtr radeonctx = RADEON_CONTEXT(ctx);
@@ -183,12 +184,22 @@ GLboolean r600EmitShader(GLcontext * ctx,
uint32_t *out;
shader_again_alloc:
+#ifdef RADEON_DEBUG_BO
pbo = radeon_bo_open(radeonctx->radeonScreen->bom,
0,
sizeinDWORD * 4,
256,
RADEON_GEM_DOMAIN_GTT,
+ 0,
+ szShaderUsage);
+#else
+ pbo = radeon_bo_open(radeonctx->radeonScreen->bom,
+ 0,
+ sizeinDWORD * 4,
+ 256,
+ RADEON_GEM_DOMAIN_GTT,
0);
+#endif /* RADEON_DEBUG_BO */
if (!pbo)
{
@@ -211,6 +222,8 @@ shader_again_alloc:
memcpy(out, data, sizeinDWORD * 4);
+ radeon_bo_unmap(pbo);
+
*shaderbo = (void*)pbo;
return GL_TRUE;