Subversion Repository Public Repository

Divide-Framework

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

Diff Revisions 911 vs 912 for /trunk/Source Code/Platform/Video/Buffers/RenderTarget/RenderTarget.cpp

Diff revisions: vs.
  @@ -30,25 +30,22 @@
30 30 RenderTarget::RenderTarget(GFXDevice& context, const RenderTargetDescriptor& descriptor)
31 31 : GUIDWrapper(),
32 32 GraphicsResource(context, getGUID()),
33 - _width(descriptor._resolution.w),
34 - _height(descriptor._resolution.h),
35 - _depthValue(1.0),
36 - _name(descriptor._name)
33 + _descriptor(descriptor)
37 34 {
38 35 if (!g_policiesInitialised) {
39 36 s_policyKeepDepth.disableState(RTDrawDescriptor::State::CLEAR_DEPTH_BUFFER);
40 37 s_policyDepthOnly.drawMask().disableAll();
41 - s_policyDepthOnly.drawMask().setEnabled(RTAttachment::Type::Depth, 0, true);
38 + s_policyDepthOnly.drawMask().setEnabled(RTAttachmentType::Depth, 0, true);
42 39 g_policiesInitialised = true;
43 40 }
44 41
45 42 if (Config::Profile::USE_2x2_TEXTURES) {
46 - _width = _height = 2;
43 + _descriptor._resolution.set(2u);
47 44 }
48 45
49 46 U8 colourAttachmentCount = 0;
50 47 for (U8 i = 0; i < descriptor._attachmentCount; ++i) {
51 - if (descriptor._attachments[i]._type == RTAttachment::Type::Colour) {
48 + if (descriptor._attachments[i]._type == RTAttachmentType::Colour) {
52 49 ++colourAttachmentCount;
53 50 }
54 51 }
  @@ -65,33 +62,32 @@
65 62 MemoryManager::DELETE(_attachmentPool);
66 63 }
67 64
68 - const RTAttachment& RenderTarget::getAttachment(RTAttachment::Type type, U8 index) const {
65 + const RTAttachment& RenderTarget::getAttachment(RTAttachmentType type, U8 index) const {
69 66 return *_attachmentPool->get(type, index);
70 67 }
71 68
72 69 /// Used by cubemap FB's
73 - void RenderTarget::drawToFace(RTAttachment::Type type, U8 index, U16 nFace, bool includeDepth) {
70 + void RenderTarget::drawToFace(RTAttachmentType type, U8 index, U16 nFace, bool includeDepth) {
74 71 drawToLayer(type, index, nFace, includeDepth);
75 72 }
76 73
77 74 void RenderTarget::readData(GFXImageFormat imageFormat, GFXDataFormat dataType, bufferPtr outData) {
78 - readData(vec4<U16>(0, 0, _width, _height), imageFormat, dataType, outData);
79 - }
80 -
81 - void RenderTarget::setClearDepth(F32 depthValue) {
82 - _depthValue = depthValue;
75 + readData(vec4<U16>(0u, 0u, _descriptor._resolution.w, _descriptor._resolution.h), imageFormat, dataType, outData);
83 76 }
84 77
85 78 U16 RenderTarget::getWidth() const {
86 - return _width;
79 + return _descriptor._resolution.w;
87 80 }
88 81
89 82 U16 RenderTarget::getHeight() const {
90 - return _height;
83 + return _descriptor._resolution.h;
91 84 }
92 85
93 86 const stringImpl& RenderTarget::getName() const {
94 - return _name;
87 + return _descriptor._name;
95 88 }
96 89
90 + F32& RenderTarget::depthClearValue() {
91 + return _descriptor._depthValue;
92 + }
97 93 };