• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 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.h: Defines a D3D11-specific class to contain shader
8 // executable implementation details.
9 
10 #ifndef LIBANGLE_RENDERER_D3D_D3D11_SHADEREXECUTABLE11_H_
11 #define LIBANGLE_RENDERER_D3D_D3D11_SHADEREXECUTABLE11_H_
12 
13 #include "libANGLE/renderer/d3d/ShaderExecutableD3D.h"
14 #include "libANGLE/renderer/d3d/d3d11/ResourceManager11.h"
15 
16 namespace gl
17 {
18 class Context;
19 }  // namespace gl
20 
21 namespace rx
22 {
23 class Renderer11;
24 class UniformStorage11;
25 
26 class ShaderExecutable11 : public ShaderExecutableD3D
27 {
28   public:
29     ShaderExecutable11(const void *function, size_t length, d3d11::PixelShader &&executable);
30     ShaderExecutable11(const void *function,
31                        size_t length,
32                        d3d11::VertexShader &&executable,
33                        d3d11::GeometryShader &&streamOut);
34     ShaderExecutable11(const void *function, size_t length, d3d11::GeometryShader &&executable);
35     ShaderExecutable11(const void *function, size_t length, d3d11::ComputeShader &&executable);
36 
37     ~ShaderExecutable11() override;
38 
39     const d3d11::PixelShader &getPixelShader() const;
40     const d3d11::VertexShader &getVertexShader() const;
41     const d3d11::GeometryShader &getGeometryShader() const;
42     const d3d11::GeometryShader &getStreamOutShader() const;
43     const d3d11::ComputeShader &getComputeShader() const;
44 
45   private:
46     d3d11::PixelShader mPixelExecutable;
47     d3d11::VertexShader mVertexExecutable;
48     d3d11::GeometryShader mGeometryExecutable;
49     d3d11::GeometryShader mStreamOutExecutable;
50     d3d11::ComputeShader mComputeExecutable;
51 };
52 
53 class UniformStorage11 : public UniformStorageD3D
54 {
55   public:
56     UniformStorage11(size_t initialSize);
57     ~UniformStorage11() override;
58 
59     angle::Result getConstantBuffer(const gl::Context *context,
60                                     Renderer11 *renderer,
61                                     const d3d11::Buffer **bufferOut);
62 
63   private:
64     d3d11::Buffer mConstantBuffer;
65 };
66 
67 }  // namespace rx
68 
69 #endif  // LIBANGLE_RENDERER_D3D_D3D11_SHADEREXECUTABLE11_H_
70