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

@@ -22,8 +22,56 @@ D3D11Shader::D3D11Shader(
const uint8_t* src_ptr, size_t length,
uint64_t hash) :
Shader(type, src_ptr, length, hash) {
// TODO(benvanik): create shader/translate/etc.
device_ = device;
device_->AddRef();
}
D3D11Shader::~D3D11Shader() {
device_->Release();
}
D3D11VertexShader::D3D11VertexShader(
ID3D11Device* device,
const uint8_t* src_ptr, size_t length,
uint64_t hash) :
handle_(0),
D3D11Shader(device, XE_GPU_SHADER_TYPE_VERTEX,
src_ptr, length, hash) {
}
D3D11VertexShader::~D3D11VertexShader() {
if (handle_) handle_->Release();
}
int D3D11VertexShader::Prepare() {
if (handle_) {
return 0;
}
// TODO(benvanik): translate/etc.
return 0;
}
D3D11PixelShader::D3D11PixelShader(
ID3D11Device* device,
const uint8_t* src_ptr, size_t length,
uint64_t hash) :
handle_(0),
D3D11Shader(device, XE_GPU_SHADER_TYPE_PIXEL,
src_ptr, length, hash) {
}
D3D11PixelShader::~D3D11PixelShader() {
if (handle_) handle_->Release();
}
int D3D11PixelShader::Prepare() {
if (handle_) {
return 0;
}
// TODO(benvanik): translate/etc.
return 0;
}