From 6cc05e63b61423ebfe3de2a8630cb2eac9ac3e29 Mon Sep 17 00:00:00 2001 From: foreman Date: Mon, 20 Jul 2015 16:52:29 -0400 Subject: [PATCH] P4 to Git Change 1172127 by dhirajk@dhirajk_fl-dhirajk-tst on 2015/07/20 16:34:29 EPR #394700 - SubAllocation Scheme for ConstantBuffers Implemented in GLL. This CL introduces sub-allocation for constant buffer for all Asics and currently supported by GLL, it can easily be opted in by OpenCL, OES as well. OpenCL changes for Sub-allocation scheme for constantbuffers. For more info please see CL#1172125 Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLContext.cpp#75 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp#126 edit [ROCm/clr commit: 05f236ee54e240b7c03f4d2c4d96c8c817609615] --- .../clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLContext.cpp | 4 +++- .../clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLContext.cpp b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLContext.cpp index 184762f691..e4e282ca26 100644 --- a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLContext.cpp +++ b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLContext.cpp @@ -131,6 +131,7 @@ CALGSLContext::open( m_cs->setRenderState(m_rs); m_rs->setCurrentFrameBufferObject(m_cs, m_fb); + m_cs->createSubAllocDesc(); // // @@ -265,6 +266,7 @@ CALGSLContext::close(gsl::gsAdaptor* native) m_cs->destroyFrameBuffer(m_fb); m_cs->destroyRenderState(m_rs); + m_cs->destroySubAllocDesc(); m_rs = 0; m_fb = 0; @@ -319,7 +321,7 @@ CALGSLContext::setConstantBuffer(uint32 physUnit, gslMemObject mem, uint32 offse m_rs->setConstantBufferObject(GSL_COMPUTE_PROGRAM, m_constantBuffers[physUnit], physUnit); } - return m_constantBuffers[physUnit]->SetMemory(m_cs, mem, static_cast(offset), (uint32)size); + return m_constantBuffers[physUnit]->bindMemory(m_cs, mem, static_cast(offset), (uint32)size); } bool diff --git a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp index a385df7d6e..5596c938ce 100644 --- a/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp +++ b/projects/clr/rocclr/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp @@ -331,6 +331,7 @@ CALGSLDevice::close() m_cs->setRenderState(0); m_cs->destroyRenderState(m_rs); + m_cs->destroySubAllocDesc(); m_rs = 0; m_adp->deleteContext(m_cs); @@ -631,6 +632,8 @@ CALGSLDevice::PerformFullInitialization_int() m_cs->Flush(); + m_cs->createSubAllocDesc(); + m_mapQuery = m_cs->createQuery(GSL_SYNC_ATI); m_mapDMAQuery = m_cs->createQuery(GSL_DRMDMA_SYNC_ATI); m_mapUVDQuery = m_cs->createQuery(GSL_UVD_SYNC_ATI);