Talvos  0.1
SPIR-V interpreter and dynamic analysis framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
PipelineStage.h
Go to the documentation of this file.
1 // Copyright (c) 2018 the Talvos developers. All rights reserved.
2 //
3 // This file is distributed under a three-clause BSD license. For full license
4 // terms please see the LICENSE file distributed with this source code.
5 
8 
9 #ifndef TALVOS_PIPELINESTAGE_H
10 #define TALVOS_PIPELINESTAGE_H
11 
12 #include <map>
13 #include <memory>
14 #include <vector>
15 
16 #include "talvos/Dim3.h"
17 #include "talvos/Object.h"
18 
19 namespace talvos
20 {
21 
22 class Device;
23 class EntryPoint;
24 class Module;
25 
27 typedef std::map<uint32_t, Object> SpecConstantMap;
28 
31 {
32 public:
41  PipelineStage(Device &D, std::shared_ptr<const Module> M,
42  const EntryPoint *EP, const SpecConstantMap &SM = {});
43 
44  // Do not allow PipelineStage objects to be copied.
46  PipelineStage(const PipelineStage &) = delete;
47  PipelineStage &operator=(const PipelineStage &) = delete;
49 
51  const EntryPoint *getEntryPoint() const { return EP; }
52 
54  Dim3 getGroupSize() const { return GroupSize; }
55 
57  std::shared_ptr<const Module> getModule() const { return Mod; }
58 
60  const std::vector<Object> &getObjects() const { return Objects; };
61 
62 private:
64  std::shared_ptr<const Module> Mod;
65 
66  const EntryPoint *EP;
68 
70  std::vector<Object> Objects;
71 };
72 
73 } // namespace talvos
74 
75 #endif
std::vector< Object > Objects
The result objects in this pipeline stage, after specialization.
Definition: PipelineStage.h:70
std::shared_ptr< const Module > Mod
The module containing the entry point to invoke.
Definition: PipelineStage.h:60
const EntryPoint * EP
The entry point to invoke.
Definition: PipelineStage.h:66
This class represents a SPIR-V module.
Definition: Module.h:37
std::shared_ptr< const Module > getModule() const
Return the module this pipeline stage is using.
Definition: PipelineStage.h:57
const EntryPoint * getEntryPoint() const
Return the entry point this pipeline stage will invoke.
Definition: PipelineStage.h:51
Class representing a 3-dimensional size or ID.
Definition: Dim3.h:22
PipelineStage & operator=(const PipelineStage &)=delete
This file declares the Dim3 class.
A Device instance encapsulates properties and state for the virtual device.
Definition: Device.h:29
This file declares the Object class.
const std::vector< Object > & getObjects() const
Returns a list of all result objects in this pipeline stage.
Definition: PipelineStage.h:60
This class encapsulates information about a pipeline stage.
Definition: PipelineStage.h:30
Dim3 getGroupSize() const
Return the workgroup size.
Definition: PipelineStage.h:54
PipelineStage(Device &D, std::shared_ptr< const Module > M, const EntryPoint *EP, const SpecConstantMap &SM={})
Create a new PipelineStage.
Dim3 GroupSize
The size of each workgroup.
Definition: PipelineStage.h:67
This class represents a shader entry point.
Definition: EntryPoint.h:25
std::map< uint32_t, Object > SpecConstantMap
Mapping from specialization constant ID to Object values.
Definition: PipelineStage.h:24