| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 // Checks if a draw buffer's format and its corresponding fragment shader | 187 // Checks if a draw buffer's format and its corresponding fragment shader |
| 188 // output's type are compatible, i.e., a signed integer typed variable is | 188 // output's type are compatible, i.e., a signed integer typed variable is |
| 189 // incompatible with a float or unsigned integer buffer. | 189 // incompatible with a float or unsigned integer buffer. |
| 190 // Return false if incompaticle. | 190 // Return false if incompaticle. |
| 191 // Otherwise, filter out the draw buffers that are not written to but are not | 191 // Otherwise, filter out the draw buffers that are not written to but are not |
| 192 // NONE through DrawBuffers, to be on the safe side. Return true. | 192 // NONE through DrawBuffers, to be on the safe side. Return true. |
| 193 // This is applied before a draw call. | 193 // This is applied before a draw call. |
| 194 bool ValidateAndAdjustDrawBuffers(uint32_t fragment_output_type_mask, | 194 bool ValidateAndAdjustDrawBuffers(uint32_t fragment_output_type_mask, |
| 195 uint32_t fragment_output_written_mask); | 195 uint32_t fragment_output_written_mask); |
| 196 | 196 |
| 197 // Filter out the draw buffers that have no images attached but are not NONE |
| 198 // through DrawBuffers, to be on the safe side. |
| 199 // This is applied before a clear call. |
| 200 void AdjustDrawBuffers(); |
| 201 |
| 197 bool ContainsActiveIntegerAttachments() const; | 202 bool ContainsActiveIntegerAttachments() const; |
| 198 | 203 |
| 199 // Return true if any draw buffers has an alpha channel. | 204 // Return true if any draw buffers has an alpha channel. |
| 200 bool HasAlphaMRT() const; | 205 bool HasAlphaMRT() const; |
| 201 | 206 |
| 202 // Return false if any two active color attachments have different internal | 207 // Return false if any two active color attachments have different internal |
| 203 // formats. | 208 // formats. |
| 204 bool HasSameInternalFormatsMRT() const; | 209 bool HasSameInternalFormatsMRT() const; |
| 205 | 210 |
| 206 void set_read_buffer(GLenum read_buffer) { | 211 void set_read_buffer(GLenum read_buffer) { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 245 |
| 241 unsigned framebuffer_complete_state_count_id() const { | 246 unsigned framebuffer_complete_state_count_id() const { |
| 242 return framebuffer_complete_state_count_id_; | 247 return framebuffer_complete_state_count_id_; |
| 243 } | 248 } |
| 244 | 249 |
| 245 // Cache color attachments' base type mask (FLOAT, INT, UINT) and bound mask. | 250 // Cache color attachments' base type mask (FLOAT, INT, UINT) and bound mask. |
| 246 // If an attachment point has no image, it's set as UNDEFINED_TYPE. | 251 // If an attachment point has no image, it's set as UNDEFINED_TYPE. |
| 247 // This call is only valid on a complete fbo. | 252 // This call is only valid on a complete fbo. |
| 248 void UpdateDrawBufferMasks(); | 253 void UpdateDrawBufferMasks(); |
| 249 | 254 |
| 255 // Helper for ValidateAndAdjustDrawBuffers() and AdjustDrawBuffers(). |
| 256 void AdjustDrawBuffersImpl(uint32_t desired_mask); |
| 257 |
| 250 // The managers that owns this. | 258 // The managers that owns this. |
| 251 FramebufferManager* manager_; | 259 FramebufferManager* manager_; |
| 252 | 260 |
| 253 bool deleted_; | 261 bool deleted_; |
| 254 | 262 |
| 255 // Service side framebuffer id. | 263 // Service side framebuffer id. |
| 256 GLuint service_id_; | 264 GLuint service_id_; |
| 257 | 265 |
| 258 // Whether this framebuffer has ever been bound. | 266 // Whether this framebuffer has ever been bound. |
| 259 bool has_been_bound_; | 267 bool has_been_bound_; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 | 380 |
| 373 scoped_refptr<FramebufferCompletenessCache> framebuffer_combo_complete_cache_; | 381 scoped_refptr<FramebufferCompletenessCache> framebuffer_combo_complete_cache_; |
| 374 | 382 |
| 375 DISALLOW_COPY_AND_ASSIGN(FramebufferManager); | 383 DISALLOW_COPY_AND_ASSIGN(FramebufferManager); |
| 376 }; | 384 }; |
| 377 | 385 |
| 378 } // namespace gles2 | 386 } // namespace gles2 |
| 379 } // namespace gpu | 387 } // namespace gpu |
| 380 | 388 |
| 381 #endif // GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ | 389 #endif // GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_MANAGER_H_ |
| OLD | NEW |