Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: gpu/command_buffer/service/context_state.h

Issue 1136713003: Add ES3 commands GetVertexAttribI{u}iv to GPU command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: switch to union Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/context_state.h
diff --git a/gpu/command_buffer/service/context_state.h b/gpu/command_buffer/service/context_state.h
index 32bef4cea3ec3f9099eb087b40090f22f2ec41bb..e4bd1318f6bd80bd382cd3eb74eae08d146abc66 100644
--- a/gpu/command_buffer/service/context_state.h
+++ b/gpu/command_buffer/service/context_state.h
@@ -101,14 +101,43 @@ struct GPU_EXPORT TextureUnit {
}
};
-struct Vec4 {
+class GPU_EXPORT Vec4 {
+ public:
+ enum DataType {
+ kFloat,
+ kInt,
+ kUInt,
+ };
+
Vec4() {
- v[0] = 0.0f;
- v[1] = 0.0f;
- v[2] = 0.0f;
- v[3] = 1.0f;
+ v_[0].float_value = 0.0f;
+ v_[1].float_value = 0.0f;
+ v_[2].float_value = 0.0f;
+ v_[3].float_value = 1.0f;
+ type_ = kFloat;
+ }
+
+ template <typename T>
+ void GetValues(T* values) const;
+
+ template <typename T>
+ void SetValues(const T* values);
+
+ DataType type() const {
+ return type_;
}
- float v[4];
+
+ bool Equal(const Vec4& other) const;
+
+ private:
+ union ValueUnion {
+ GLfloat float_value;
+ GLint int_value;
+ GLuint uint_value;
+ };
+
+ ValueUnion v_[4];
+ DataType type_;
};
struct GPU_EXPORT ContextState {

Powered by Google App Engine
This is Rietveld 408576698