Subversion Repository Public Repository

Divide-Framework

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

Diff Revisions 749 vs 750 for /trunk/Source Code/Geometry/Material/Headers/Material.h

Diff revisions: vs.
  @@ -111,6 +111,15 @@
111 111 {
112 112 }
113 113
114 + ShaderData(const ShaderData& other)
115 + : _diffuse(other._diffuse),
116 + _specular(other._specular),
117 + _emissive(other._emissive),
118 + _shininess(other._shininess),
119 + _textureCount(other._textureCount)
120 + {
121 + }
122 +
114 123 ShaderData& operator=(const ShaderData& other) {
115 124 _diffuse.set(other._diffuse);
116 125 _specular.set(other._specular);
  @@ -133,13 +142,6 @@
133 142 COUNT
134 143 };
135 144
136 - bool _customShader;
137 - ShaderProgram_ptr _shaderRef;
138 - stringImpl _shader;
139 - RenderStage _stage;
140 - std::atomic<ShaderCompilationStage> _shaderCompStage;
141 - vectorImplAligned<stringImpl> _shaderDefines;
142 -
143 145 const ShaderProgram_ptr& getProgram() const;
144 146
145 147 inline StateTracker<bool>& getTrackedBools() { return _trackedBools; }
  @@ -156,21 +158,37 @@
156 158 _shadingFunction[i].fill(0);
157 159 }
158 160 }
161 +
162 + ShaderInfo(const ShaderInfo& other)
163 + : _stage(other._stage),
164 + _customShader(other._customShader),
165 + _shaderRef(other._shaderRef),
166 + _shader(other._shader),
167 + _shadingFunction(other._shadingFunction),
168 + _trackedBools(other._trackedBools),
169 + _shaderDefines(other._shaderDefines)
170 + {
171 + _shaderCompStage.store(other._shaderCompStage);
172 + }
159 173
160 174 ShaderInfo& operator=(const ShaderInfo& other) {
175 + _stage = other._stage;
161 176 _customShader = other._customShader;
162 177 _shaderRef = other._shaderRef;
163 178 _shader = other._shader;
164 179 _shaderCompStage.store(other._shaderCompStage);
165 - for (U32 i = 0; i < to_const_uint(ShaderType::COUNT); ++i) {
166 - for (U32 j = 0; j < to_const_uint(BumpMethod::COUNT); ++j) {
167 - _shadingFunction[i][j] = other._shadingFunction[i][j];
168 - }
169 - }
180 + _shadingFunction = other._shadingFunction;
170 181 _trackedBools = other._trackedBools;
182 + _shaderDefines = other._shaderDefines;
171 183 return *this;
172 184 }
173 185
186 + bool _customShader;
187 + ShaderProgram_ptr _shaderRef;
188 + stringImpl _shader;
189 + RenderStage _stage;
190 + std::atomic<ShaderCompilationStage> _shaderCompStage;
191 + vectorImplAligned<stringImpl> _shaderDefines;
174 192 std::array<std::array<U32, to_const_uint(BumpMethod::COUNT)>,
175 193 to_const_uint(ShaderType::COUNT)> _shadingFunction;
176 194
  @@ -362,8 +380,8 @@
362 380 void updateReflectionIndex(I32 index);
363 381 void updateRefractionIndex(I32 index);
364 382
365 - void defaultReflectionTexture(Texture_ptr reflectionPtr, U32 arrayIndex);
366 - void defaultRefractionTexture(Texture_ptr reflectionPtr, U32 arrayIndex);
383 + void defaultReflectionTexture(const Texture_ptr& reflectionPtr, U32 arrayIndex);
384 + void defaultRefractionTexture(const Texture_ptr& reflectionPtr, U32 arrayIndex);
367 385
368 386 inline U32 defaultReflectionTextureIndex() const { return _reflectionIndex > -1 ? to_uint(_reflectionIndex) : _defaultReflection.second; }
369 387 inline U32 defaultRefractionTextureIndex() const { return _refractionIndex > -1 ? to_uint(_refractionIndex) : _defaultRefraction.second; }