Index: gpu/command_buffer/service/program_manager.h |
diff --git a/gpu/command_buffer/service/program_manager.h b/gpu/command_buffer/service/program_manager.h |
index 734e50fc03b5f8cdad588617af8b141725d7d5f4..5c58ec4089425547631463790a474c995a322276 100644 |
--- a/gpu/command_buffer/service/program_manager.h |
+++ b/gpu/command_buffer/service/program_manager.h |
@@ -386,6 +386,16 @@ class GPU_EXPORT Program : public base::RefCounted<Program> { |
return transform_feedback_buffer_mode_; |
} |
+ // Return each draw buffer's corresponding fragment shader output variable's |
+ // base type: FLOAT, INT, or UINT. |
+ // If the draw buffer has no corresponding output variable, its base type |
+ // is UNDEFINED_TYPE. |
+ // The data are only valid after a successful link. |
+ const std::vector<ShaderVariableBaseType>& GetFragmentOutputBaseTypes( |
+ ) const { |
+ return fragment_output_base_types_; |
+ } |
+ |
private: |
friend class base::RefCounted<Program>; |
friend class ProgramManager; |
@@ -422,6 +432,7 @@ class GPU_EXPORT Program : public base::RefCounted<Program> { |
void UpdateUniforms(); |
void UpdateFragmentInputs(); |
void UpdateProgramOutputs(); |
+ void UpdateFragmentOutputBaseTypes(); |
// Process the program log, replacing the hashed names with original names. |
std::string ProcessLogInfo(const std::string& log); |
@@ -451,6 +462,8 @@ class GPU_EXPORT Program : public base::RefCounted<Program> { |
void DetachShaders(ShaderManager* manager); |
+ void ResetFragmentOutputBaseTypes(); |
+ |
static inline size_t GetUniformLocationIndexFromFakeLocation( |
GLint fake_location) { |
return static_cast<size_t>(fake_location & 0xFFFF); |
@@ -493,8 +506,7 @@ class GPU_EXPORT Program : public base::RefCounted<Program> { |
GLuint service_id_; |
// Shaders by type of shader. |
- scoped_refptr<Shader> |
- attached_shaders_[kMaxAttachedShaders]; |
+ scoped_refptr<Shader> attached_shaders_[kMaxAttachedShaders]; |
// True if this program is marked as deleted. |
bool deleted_; |
@@ -528,6 +540,9 @@ class GPU_EXPORT Program : public base::RefCounted<Program> { |
// output variable - (location,index) binding map from |
// glBindFragDataLocation() and ..IndexedEXT() calls. |
LocationIndexMap bind_program_output_location_index_map_; |
+ |
+ // Fragment output variable base types: FLOAT, INT, or UINT. |
+ std::vector<ShaderVariableBaseType> fragment_output_base_types_; |
}; |
// Tracks the Programs. |
@@ -538,6 +553,7 @@ class GPU_EXPORT ProgramManager { |
public: |
ProgramManager(ProgramCache* program_cache, |
uint32_t max_varying_vectors, |
+ uint32_t max_draw_buffers, |
uint32_t max_dual_source_draw_buffers, |
const GpuPreferences& gpu_preferences, |
FeatureInfo* feature_info); |
@@ -581,6 +597,8 @@ class GPU_EXPORT ProgramManager { |
uint32_t max_varying_vectors() const { return max_varying_vectors_; } |
+ uint32_t max_draw_buffers() const { return max_draw_buffers_; } |
+ |
uint32_t max_dual_source_draw_buffers() const { |
return max_dual_source_draw_buffers_; |
} |
@@ -611,6 +629,7 @@ class GPU_EXPORT ProgramManager { |
ProgramCache* program_cache_; |
uint32_t max_varying_vectors_; |
+ uint32_t max_draw_buffers_; |
uint32_t max_dual_source_draw_buffers_; |
const GpuPreferences& gpu_preferences_; |