Shader type read for translation.

This commit is contained in:
Ben Vanik
2013-10-11 22:04:34 -07:00
parent 1378fad3c0
commit 04aad708c9
7 changed files with 113 additions and 7 deletions

View File

@@ -15,6 +15,7 @@
using namespace xe;
using namespace xe::gpu;
using namespace xe::gpu::d3d11;
using namespace xe::gpu::xenos;
D3D11ShaderCache::D3D11ShaderCache(ID3D11Device* device) {
@@ -30,9 +31,15 @@ Shader* D3D11ShaderCache::CreateCore(
xenos::XE_GPU_SHADER_TYPE type,
const uint8_t* src_ptr, size_t length,
uint32_t hash) {
return new D3D11Shader(
device_,
type,
src_ptr, length,
hash);
switch (type) {
case XE_GPU_SHADER_TYPE_VERTEX:
return new D3D11VertexShader(
device_, src_ptr, length, hash);
case XE_GPU_SHADER_TYPE_PIXEL:
return new D3D11PixelShader(
device_, src_ptr, length, hash);
default:
XEASSERTALWAYS();
return NULL;
}
}