Move shader cache into Renderer
Trac #21727
git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1333 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/renderer/Renderer.cpp b/src/libGLESv2/renderer/Renderer.cpp
index 786b075..baacc80 100644
--- a/src/libGLESv2/renderer/Renderer.cpp
+++ b/src/libGLESv2/renderer/Renderer.cpp
@@ -199,6 +199,9 @@
ASSERT(SUCCEEDED(result));
}
+ mVertexShaderCache.initialize(mDevice);
+ mPixelShaderCache.initialize(mDevice);
+
initializeDevice();
return EGL_SUCCESS;
@@ -344,6 +347,16 @@
}
}
+IDirect3DVertexShader9 *Renderer::createVertexShader(const DWORD *function, size_t length)
+{
+ return mVertexShaderCache.create(function, length);
+}
+
+IDirect3DPixelShader9 *Renderer::createPixelShader(const DWORD *function, size_t length)
+{
+ return mPixelShaderCache.create(function, length);
+}
+
void Renderer::releaseDeviceResources()
{
while (!mEventQueryPool.empty())
@@ -351,6 +364,9 @@
mEventQueryPool.back()->Release();
mEventQueryPool.pop_back();
}
+
+ mVertexShaderCache.clear();
+ mPixelShaderCache.clear();
}