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

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

Issue 1843663007: gpu: Pull some variables onto the stack in the decoder CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:wi… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
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 7a1628fc6b835178865826192bd7a0a85530230e..53ce95e3fa80d6c18415d22765a5f80744535f45 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -8857,6 +8857,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() ==
@@ -8865,7 +8866,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");
@@ -8877,7 +8878,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");
@@ -12835,11 +12835,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();
@@ -14172,7 +14173,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.";
@@ -14766,6 +14767,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*>(
@@ -14778,7 +14780,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;
}
@@ -14810,7 +14812,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