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

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

Issue 1822643002: [Command buffer] Enable primitive restart for WebGL 2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix coding style and update webgl2_conformance_expectations.py Created 4 years, 9 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/buffer_manager.h
diff --git a/gpu/command_buffer/service/buffer_manager.h b/gpu/command_buffer/service/buffer_manager.h
index 33df818647966ed15770dcbe77aa83e0f05e2e55..ba0c232116a0e88d335ad5126321940fdffd3a92 100644
--- a/gpu/command_buffer/service/buffer_manager.h
+++ b/gpu/command_buffer/service/buffer_manager.h
@@ -63,7 +63,7 @@ class GPU_EXPORT Buffer : public base::RefCounted<Buffer> {
// offset is in bytes.
// count is in elements of type.
bool GetMaxValueForRange(GLuint offset, GLsizei count, GLenum type,
- GLuint* max_value);
+ bool primitive_restart_enabled, GLuint* max_value);
// Returns a pointer to shadowed data.
const void* GetRange(GLintptr offset, GLsizeiptr size) const;
@@ -101,10 +101,12 @@ class GPU_EXPORT Buffer : public base::RefCounted<Buffer> {
// Represents a range in a buffer.
class Range {
public:
- Range(GLuint offset, GLsizei count, GLenum type)
+ Range(GLuint offset, GLsizei count, GLenum type,
+ bool primitive_restart_enabled)
: offset_(offset),
count_(count),
- type_(type) {
+ type_(type),
+ primitive_restart_enabled_(primitive_restart_enabled) {
}
// A less functor provided for std::map so it can find ranges.
@@ -116,7 +118,10 @@ class GPU_EXPORT Buffer : public base::RefCounted<Buffer> {
if (lhs.count_ != rhs.count_) {
return lhs.count_ < rhs.count_;
}
- return lhs.type_ < rhs.type_;
+ if (lhs.type_ != rhs.type_) {
+ return lhs.type_ < rhs.type_;
+ }
+ return lhs.primitive_restart_enabled_ < rhs.primitive_restart_enabled_;
}
};
@@ -124,6 +129,7 @@ class GPU_EXPORT Buffer : public base::RefCounted<Buffer> {
GLuint offset_;
GLsizei count_;
GLenum type_;
+ bool primitive_restart_enabled_;
};
~Buffer();
@@ -269,6 +275,8 @@ class GPU_EXPORT BufferManager : public base::trace_event::MemoryDumpProvider {
// set to a non-zero size.
bool UseNonZeroSizeForClientSideArrayBuffer();
+ void SetPrimitiveRestartFixedIndexIfNecessary(GLenum type);
+
Buffer* GetBufferInfoForTarget(ContextState* state, GLenum target) const;
// base::trace_event::MemoryDumpProvider implementation.
@@ -326,6 +334,8 @@ class GPU_EXPORT BufferManager : public base::trace_event::MemoryDumpProvider {
// Allows to check no Buffer will outlive this.
unsigned int buffer_count_;
+ GLuint primitive_restart_fixed_index_;
+
bool have_context_;
bool use_client_side_arrays_for_stream_buffers_;
« no previous file with comments | « content/test/gpu/gpu_tests/webgl2_conformance_expectations.py ('k') | gpu/command_buffer/service/buffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698