blob: 96ab8e831392a616cad0c483dc050bd698031be4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
#pragma once
#include "tools/gfx/renderer-shared.h"
#include "core/slang-basic.h"
#include "tools/gfx/slang-context.h"
namespace gfx
{
class GraphicsCommonProgramLayout;
class GraphicsCommonShaderProgram : public ShaderProgramBase
{
public:
GraphicsCommonProgramLayout* getLayout() const;
private:
friend class GraphicsAPIRenderer;
Slang::RefPtr<ShaderObjectLayoutBase> m_layout;
};
class GraphicsComputeCommandEncoderBase
{
public:
RendererBase* m_rendererBase;
Slang::RefPtr<PipelineStateBase> m_currentPipeline;
virtual SLANG_NO_THROW void SLANG_MCALL setDescriptorSetImpl(
PipelineType pipelineType,
IPipelineLayout* layout,
UInt index,
IDescriptorSet* descriptorSet) = 0;
virtual SLANG_NO_THROW void SLANG_MCALL uploadBufferDataImpl(
IBufferResource* buffer, size_t offset, size_t size, void* data) = 0;
Result bindRootShaderObjectImpl(PipelineType pipelineType, IShaderObject* object);
};
class GraphicsAPIRenderer : public RendererBase
{
public:
virtual Result createShaderObjectLayout(
slang::TypeLayoutReflection* typeLayout,
ShaderObjectLayoutBase** outLayout) SLANG_OVERRIDE;
virtual Result createShaderObject(
ShaderObjectLayoutBase* layout,
IShaderObject** outObject) SLANG_OVERRIDE;
virtual SLANG_NO_THROW Result SLANG_MCALL createRootShaderObject(
IShaderProgram* program,
IShaderObject** outObject) SLANG_OVERRIDE;
void preparePipelineDesc(GraphicsPipelineStateDesc& desc);
void preparePipelineDesc(ComputePipelineStateDesc& desc);
Result initProgramCommon(
GraphicsCommonShaderProgram* program,
IShaderProgram::Desc const& desc);
};
}
|