blob: b1aeb9c25a9ea26e6b9fe76633d052830a588365 [file] [log] [blame]
daniel@transgaming.com813bb782012-11-28 21:03:30 +00001//
2// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
3// Use of this source code is governed by a BSD-style license that can be
4// found in the LICENSE file.
5//
6
7// ShaderExecutable11.cpp: Implements a D3D11-specific class to contain shader
8// executable implementation details.
9
10#include "libGLESv2/renderer/ShaderExecutable11.h"
11
12#include "common/debug.h"
13
14namespace rx
15{
16
daniel@transgaming.com7b18d0c2012-11-28 21:04:10 +000017ShaderExecutable11::ShaderExecutable11(const void *function, size_t length, ID3D11PixelShader *executable)
18 : ShaderExecutable(function, length)
daniel@transgaming.com813bb782012-11-28 21:03:30 +000019{
20 mPixelExecutable = executable;
21 mVertexExecutable = NULL;
22}
23
daniel@transgaming.com7b18d0c2012-11-28 21:04:10 +000024ShaderExecutable11::ShaderExecutable11(const void *function, size_t length, ID3D11VertexShader *executable)
25 : ShaderExecutable(function, length)
daniel@transgaming.com813bb782012-11-28 21:03:30 +000026{
27 mVertexExecutable = executable;
28 mPixelExecutable = NULL;
29}
30
31ShaderExecutable11::~ShaderExecutable11()
32{
33 if (mVertexExecutable)
34 {
35 mVertexExecutable->Release();
36 }
37 if (mPixelExecutable)
38 {
39 mPixelExecutable->Release();
40 }
41}
42
43ShaderExecutable11 *ShaderExecutable11::makeShaderExecutable11(ShaderExecutable *executable)
44{
45 ASSERT(dynamic_cast<ShaderExecutable11*>(executable) != NULL);
46 return static_cast<ShaderExecutable11*>(executable);
47}
48
daniel@transgaming.com813bb782012-11-28 21:03:30 +000049ID3D11VertexShader *ShaderExecutable11::getVertexShader()
50{
51 return mVertexExecutable;
52}
53
54ID3D11PixelShader *ShaderExecutable11::getPixelShader()
55{
56 return mPixelExecutable;
57}
58
59gl::D3DConstantTable *ShaderExecutable11::getConstantTable()
60{
61 return NULL;
62}
63
64}