Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*
Copyright (c) 2018 DIVIDE-Studio
Copyright (c) 2009 Ionut Cava

This file is part of DIVIDE Framework.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software
and associated documentation files (the "Software"), to deal in the Software
without restriction,
including without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

*/

#ifndef _PIPELINE_H_
#define _PIPELINE_H_

#include "PushConstants.h"
#include "DescriptorSets.h"
#include "Core/Headers/Hashable.h"
#include "Utility/Headers/TextLabel.h"
#include "Platform/Video/Shaders/Headers/ShaderProgram.h"

namespace Divide {

enum class MemoryBarrierType : U32 {
    BUFFER = 0,
    TEXTURE = 1,
    RENDER_TARGET = 2,
    TRANSFORM_FEEDBACK = 3,
    COUNTER = 4,
    QUERY = 5,
    SHADER_BUFFER = 6,
    ALL = 7,
    COUNT
};

struct ComputeParams {
    MemoryBarrierType _barrierType = MemoryBarrierType::COUNT;
    vec3<U32> _groupSize;
};

typedef hashMapImpl<ShaderType, vectorImpl<U32>> ShaderFunctions;

class PipelineDescriptor : public Hashable {
  public:
    size_t getHash() const override;

    U8 _multiSampleCount = 0;
    size_t _stateHash = 0;
    ShaderProgram_wptr _shaderProgram;
    ShaderFunctions _shaderFunctions;
}; //struct PipelineDescriptor

class Pipeline {
public:
    Pipeline(const PipelineDescriptor& descriptor);

    inline ShaderProgram* shaderProgram() const {
        return _descriptor._shaderProgram.expired() ? nullptr : _descriptor._shaderProgram.lock().get();
    }

    inline const PipelineDescriptor& descriptor() const {
        return _descriptor;
    }

    inline size_t stateHash() const {
        return _descriptor._stateHash;
    }

    inline U8 multiSampleCount() const{
        return _descriptor._multiSampleCount;
    }


    inline const ShaderFunctions& shaderFunctions() const {
        return _descriptor._shaderFunctions;
    }

    inline size_t getHash() const {
        return _descriptor.getHash();
    }

    bool operator==(const Pipeline &other) const;
    bool operator!=(const Pipeline &other) const;

private: //data
    PipelineDescriptor _descriptor;

}; //class Pipeline

}; //namespace Divide

#endif //_PIPELINE_H_

Commits for Divide-Framework/trunk/Source Code/Platform/Video/Headers/Pipeline.h

Diff revisions: vs.
Revision Author Commited Message
1029 Diff Diff IonutCava picture IonutCava Tue 30 Jan, 2018 17:28:39 +0000

[Ionut]
- Update copyright notices

953 Diff Diff IonutCava picture IonutCava Sat 28 Oct, 2017 21:57:10 +0000

[Ionut]
- Fix blinking issue by caching and hashing pipelines to that we don’t overwrite pipelines used by other elements

950 Diff Diff IonutCava picture IonutCava Sun 22 Oct, 2017 22:25:05 +0000

[Ionut]
- Revamp camera management
- More work on improving the command buffer system:
— Performance tweaks
— Validation
— Debug features
- Some code cleanup for Object3D stuff (preRender/onRender changes)

Still haven’t fixed random flashing issue

933 Diff Diff IonutCava picture IonutCava Tue 15 Aug, 2017 00:02:05 +0000

[Ionut]
- CommandBuffer Part 2/3: code compiles and splash screen renders and application doesn’t crash (still has drawing issues)

932 Diff Diff IonutCava picture IonutCava Mon 14 Aug, 2017 16:17:59 +0000

[Ionut]
- Transition every GPU call to the new GFX::CommandBuffer system.
- Part 1/3: Infrastructure. Does not compile yet; (ToDo: part 2/3: transition commands to new infrastructure. part 3/3: debug and optimize)

Currently supported commands:
BEGIN_RENDER_PASS
END_RENDER_PASS
BEGIN_RENDER_SUB_PASS
END_RENDER_SUB_PASS
SET_VIEWPORT
SET_SCISSOR
BIND_PIPELINE
BIND_DESCRIPTOR_SETS
SEND_PUSH_CONSTANTS
DRAW_COMMANDS
DRAW_TEXT
DISPATCH_COMPUTE

929 Diff Diff IonutCava picture IonutCava Sat 12 Aug, 2017 17:34:44 +0000

[Ionut]
- More work on finishing up new PushConstant / Command buffer rendering system:
— Everything compiles and runs but with graphical and performance issues

895 Diff Diff IonutCava picture IonutCava Wed 21 Jun, 2017 21:10:26 +0000

[IonutCava]
- Reorder and cleanup OpenGL backend a bit.
- Small code cleanup
- Some small profile-guided optimizations

893 IonutCava picture IonutCava Sun 18 Jun, 2017 17:33:07 +0000

[Ionut]
- Initial implementation of a PipelineStateObject (holds shader program, rasterizer state, etc)
- Rework PCH implementation a bit because VS2017 no longer has a /ZM option