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

Unified Diff: gpu/command_buffer/common/gles2_cmd_format_autogen.h

Issue 954183006: Add glDrawRangeElements to GPU command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/common/gles2_cmd_format_autogen.h
diff --git a/gpu/command_buffer/common/gles2_cmd_format_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_autogen.h
index 71b1f3fcb947255fe6d2ba2a3223f6b443d0d728..5dedd2866d00396ef37a8df99f0bbca608d91ca1 100644
--- a/gpu/command_buffer/common/gles2_cmd_format_autogen.h
+++ b/gpu/command_buffer/common/gles2_cmd_format_autogen.h
@@ -2660,6 +2660,71 @@ static_assert(offsetof(DrawElements, type) == 12,
static_assert(offsetof(DrawElements, index_offset) == 16,
"offset of DrawElements index_offset should be 16");
+struct DrawRangeElements {
+ typedef DrawRangeElements ValueType;
+ static const CommandId kCmdId = kDrawRangeElements;
+ static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+ static const uint8 cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(2);
+
+ static uint32_t ComputeSize() {
+ return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT
+ }
+
+ void SetHeader() { header.SetCmd<ValueType>(); }
+
+ void Init(GLenum _mode,
+ GLuint _start,
+ GLuint _end,
+ GLsizei _count,
+ GLenum _type,
+ GLuint _index_offset) {
+ SetHeader();
+ mode = _mode;
+ start = _start;
+ end = _end;
+ count = _count;
+ type = _type;
+ index_offset = _index_offset;
+ }
+
+ void* Set(void* cmd,
+ GLenum _mode,
+ GLuint _start,
+ GLuint _end,
+ GLsizei _count,
+ GLenum _type,
+ GLuint _index_offset) {
+ static_cast<ValueType*>(cmd)
+ ->Init(_mode, _start, _end, _count, _type, _index_offset);
+ return NextCmdAddress<ValueType>(cmd);
+ }
+
+ gpu::CommandHeader header;
+ uint32_t mode;
+ uint32_t start;
+ uint32_t end;
+ int32_t count;
+ uint32_t type;
+ uint32_t index_offset;
+};
+
+static_assert(sizeof(DrawRangeElements) == 28,
+ "size of DrawRangeElements should be 28");
+static_assert(offsetof(DrawRangeElements, header) == 0,
+ "offset of DrawRangeElements header should be 0");
+static_assert(offsetof(DrawRangeElements, mode) == 4,
+ "offset of DrawRangeElements mode should be 4");
+static_assert(offsetof(DrawRangeElements, start) == 8,
+ "offset of DrawRangeElements start should be 8");
+static_assert(offsetof(DrawRangeElements, end) == 12,
+ "offset of DrawRangeElements end should be 12");
+static_assert(offsetof(DrawRangeElements, count) == 16,
+ "offset of DrawRangeElements count should be 16");
+static_assert(offsetof(DrawRangeElements, type) == 20,
+ "offset of DrawRangeElements type should be 20");
+static_assert(offsetof(DrawRangeElements, index_offset) == 24,
+ "offset of DrawRangeElements index_offset should be 24");
+
struct Enable {
typedef Enable ValueType;
static const CommandId kCmdId = kEnable;

Powered by Google App Engine
This is Rietveld 408576698