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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 1836603002: gpu: Pull some variables onto the stack in the decoder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « gpu/command_buffer/service/common_decoder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 7ecd8d5f47bf07b2f1410eb945e5d1295423c7b6..05ba2c9c1efe3d707969c25500436b32f42a415f 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -8958,6 +8958,7 @@ error::Error GLES2DecoderImpl::HandleVertexAttribIPointer(
const gles2::cmds::VertexAttribIPointer& c =
*static_cast<const gles2::cmds::VertexAttribIPointer*>(cmd_data);
+ GLsizei offset = c.offset;
if (!state_.bound_array_buffer.get() ||
state_.bound_array_buffer->IsDeleted()) {
if (state_.vertex_attrib_manager.get() ==
@@ -8966,7 +8967,7 @@ error::Error GLES2DecoderImpl::HandleVertexAttribIPointer(
GL_INVALID_OPERATION,
"glVertexAttribIPointer", "no array buffer bound");
return error::kNoError;
- } else if (c.offset != 0) {
+ } else if (offset != 0) {
LOCAL_SET_GL_ERROR(
GL_INVALID_OPERATION,
"glVertexAttribIPointer", "client side arrays are not allowed");
@@ -8978,7 +8979,6 @@ error::Error GLES2DecoderImpl::HandleVertexAttribIPointer(
GLint size = c.size;
GLenum type = c.type;
GLsizei stride = c.stride;
- GLsizei offset = c.offset;
const void* ptr = reinterpret_cast<const void*>(offset);
if (!validators_->vertex_attrib_i_type.IsValid(type)) {
LOCAL_SET_GL_ERROR_INVALID_ENUM("glVertexAttribIPointer", type, "type");
@@ -13149,11 +13149,12 @@ error::Error GLES2DecoderImpl::HandleWaitSyncTokenCHROMIUM(
const gpu::CommandBufferNamespace kMaxNamespaceId =
gpu::CommandBufferNamespace::NUM_COMMAND_BUFFER_NAMESPACES;
- const gpu::CommandBufferNamespace namespace_id =
- ((c.namespace_id >= static_cast<int32_t>(kMinNamespaceId)) &&
- (c.namespace_id < static_cast<int32_t>(kMaxNamespaceId)))
- ? static_cast<gpu::CommandBufferNamespace>(c.namespace_id)
- : gpu::CommandBufferNamespace::INVALID;
+ gpu::CommandBufferNamespace namespace_id =
+ static_cast<gpu::CommandBufferNamespace>(c.namespace_id);
+ if ((namespace_id < static_cast<int32_t>(kMinNamespaceId)) &&
+ (namespace_id >= static_cast<int32_t>(kMaxNamespaceId))) {
+ namespace_id = gpu::CommandBufferNamespace::INVALID;
+ }
const CommandBufferId command_buffer_id =
CommandBufferId::FromUnsafeValue(c.command_buffer_id());
const uint64_t release = c.release_count();
@@ -14490,7 +14491,7 @@ void GLES2DecoderImpl::ProduceTextureRef(const char* func_name,
TextureRef* texture_ref,
GLenum target,
const GLbyte* data) {
- const Mailbox& mailbox = *reinterpret_cast<const Mailbox*>(data);
+ const Mailbox mailbox = *reinterpret_cast<const Mailbox*>(data);
DLOG_IF(ERROR, !mailbox.Verify()) << func_name << " was passed a "
"mailbox that was not generated by "
"GenMailboxCHROMIUM.";
@@ -15084,6 +15085,7 @@ error::Error GLES2DecoderImpl::HandleMapBufferRange(
GLbitfield access = static_cast<GLbitfield>(c.access);
GLintptr offset = static_cast<GLintptr>(c.offset);
GLsizeiptr size = static_cast<GLsizeiptr>(c.size);
+ uint32_t data_shm_id = static_cast<uint32_t>(c.data_shm_id);
typedef cmds::MapBufferRange::Result Result;
Result* result = GetSharedMemoryAs<Result*>(
@@ -15096,7 +15098,7 @@ error::Error GLES2DecoderImpl::HandleMapBufferRange(
return error::kInvalidArguments;
}
int8_t* mem =
- GetSharedMemoryAs<int8_t*>(c.data_shm_id, c.data_shm_offset, size);
+ GetSharedMemoryAs<int8_t*>(data_shm_id, c.data_shm_offset, size);
if (!mem) {
return error::kOutOfBounds;
}
@@ -15128,7 +15130,7 @@ error::Error GLES2DecoderImpl::HandleMapBufferRange(
Buffer* buffer = buffer_manager()->GetBufferInfoForTarget(&state_, target);
DCHECK(buffer);
buffer->SetMappedRange(offset, size, access, ptr,
- GetSharedMemoryBuffer(c.data_shm_id));
+ GetSharedMemoryBuffer(data_shm_id));
if ((access & GL_MAP_INVALIDATE_RANGE_BIT) == 0) {
memcpy(mem, ptr, size);
}
« no previous file with comments | « gpu/command_buffer/service/common_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698