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
#include "Headers/RTAttachment.h"

namespace Divide {

RTAttachment::RTAttachment()
    : _clearColour(DefaultColours::WHITE()),
      _descriptor(TextureDescriptor()),
      _needsRefresh(false),
      _attDirty(false),
      _enabled(false)
{
}

RTAttachment::~RTAttachment()
{
}

TextureDescriptor& RTAttachment::descriptor() {
    return _descriptor;
}

const TextureDescriptor& RTAttachment::descriptor() const {
    return _descriptor;
}

void RTAttachment::flush() {
}

bool RTAttachment::used() const {
    return false;
}

bool RTAttachment::enabled() const {
    return _enabled;
}

void RTAttachment::enabled(const bool state) {
    _enabled = state;
}

bool RTAttachment::changed() const {
    return _needsRefresh;
}

void RTAttachment::fromDescriptor(const TextureDescriptor& descriptor) {
    _descriptor = descriptor;
    _needsRefresh = true;
}

void RTAttachment::clearColour(const vec4<F32>& clearColour) {
    _clearColour.set(clearColour);
}

const vec4<F32>& RTAttachment::clearColour() const {
    return _clearColour;
}


RTAttachmentPool::RTAttachmentPool()
{
 
}

RTAttachmentPool::~RTAttachmentPool()
{
}


const RTAttachment_ptr& RTAttachmentPool::get(RTAttachment::Type type, U8 index) const {
    
    switch(type) {
        case RTAttachment::Type::Colour :
        {
            assert(index < attachmentCount(type));
            return _attachment[to_const_uint(RTAttachment::Type::Colour)][index];
        }
        case RTAttachment::Type::Depth :
        {
            assert(index == 0);
            return _attachment[to_const_uint(RTAttachment::Type::Depth)].front();
        }
        case RTAttachment::Type::Stencil:
        {
            assert(index == 0);
            return _attachment[to_const_uint(RTAttachment::Type::Stencil)].front();
        }
    }

    DIVIDE_UNEXPECTED_CALL("Invalid render target attachment type");
    return _attachment[0][0];
}

U8 RTAttachmentPool::attachmentCount(RTAttachment::Type type) const {
    return to_ubyte(_attachment[to_uint(type)].size());
}

bool RTAttachment::dirty() const {
    return _attDirty;
}

void RTAttachment::flagDirty() {
    _attDirty = true;
}

void RTAttachment::clean() {
    _attDirty = false;
}

}; //namespace Divide

Commits for Divide-Framework/trunk/Source Code/Platform/Video/Buffers/RenderTarget/RTAttachment.cpp

Diff revisions: vs.
Revision Author Commited Message
727 Diff Diff IonutCava picture IonutCava Tue 14 Jun, 2016 16:01:38 +0000

[IonutCava]
- Remove node and cmd buffers from GFXDevice and add them as a new BufferData struct to RenderPass class.
— Each render pass holds its own buffers
- Improvements / fixes to the CSM code
- Added a global toggle to enable/disable custom memory allocators

722 IonutCava picture IonutCava Thu 09 Jun, 2016 16:15:33 +0000

[IonutCava]
- Restructure RenderTarget system:
— Separate attachments, use an attachment pool, use draw descriptors, require explicit information for RT calls, etc