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

Unified Diff: command_buffer/service/cross/gapi_decoder.cc

Issue 222017: Fix to allow NOOP to work again. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: Created 11 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: command_buffer/service/cross/gapi_decoder.cc
===================================================================
--- command_buffer/service/cross/gapi_decoder.cc (revision 27027)
+++ command_buffer/service/cross/gapi_decoder.cc (working copy)
@@ -90,7 +90,7 @@
const CommandInfo& info = g_command_info[command];
unsigned int info_arg_count = static_cast<unsigned int>(info.arg_count);
if ((info.arg_flags == cmd::kFixed && arg_count == info_arg_count) ||
- (info.arg_flags == cmd::kAtLeastN && arg_count > info_arg_count)) {
+ (info.arg_flags == cmd::kAtLeastN && arg_count >= info_arg_count)) {
switch (command) {
#define O3D_COMMAND_BUFFER_CMD_OP(name) \
case cmd::name::kCmdId: \
@@ -190,8 +190,12 @@
BufferSyncInterface::ParseError GAPIDecoder::HandleSetVertexBufferDataImmediate(
uint32 arg_count,
const cmd::SetVertexBufferDataImmediate& args) {
+ uint32 size = ImmediateDataSize(arg_count, args);
+ if (size == 0) {
+ return ParseError::kParseNoError;
+ }
return gapi_->SetVertexBufferData(args.id, args.offset,
- ImmediateDataSize(arg_count, args),
+ size,
AddressAfterStruct(args));
}
@@ -236,8 +240,11 @@
BufferSyncInterface::ParseError GAPIDecoder::HandleSetIndexBufferDataImmediate(
uint32 arg_count,
const cmd::SetIndexBufferDataImmediate& args) {
- return gapi_->SetIndexBufferData(args.id, args.offset,
- ImmediateDataSize(arg_count, args),
+ uint32 size = ImmediateDataSize(arg_count, args);
+ if (size == 0) {
+ return ParseError::kParseNoError;
+ }
+ return gapi_->SetIndexBufferData(args.id, args.offset, size,
AddressAfterStruct(args));
}
@@ -354,6 +361,9 @@
uint32 data_size = ImmediateDataSize(arg_count, args);
if (size > data_size)
return BufferSyncInterface::kParseInvalidArguments;
+ if (data_size == 0) {
+ return ParseError::kParseNoError;
+ }
return gapi_->CreateEffect(args.id, size, AddressAfterStruct(args));
}
@@ -411,6 +421,9 @@
uint32 data_size = ImmediateDataSize(arg_count, args);
if (size > data_size)
return BufferSyncInterface::kParseInvalidArguments;
+ if (data_size == 0) {
+ return ParseError::kParseNoError;
+ }
return gapi_->CreateParamByName(args.param_id, args.effect_id, size,
AddressAfterStruct(args));
}
@@ -443,6 +456,9 @@
uint32 data_size = ImmediateDataSize(arg_count, args);
if (size > data_size)
return BufferSyncInterface::kParseInvalidArguments;
+ if (data_size == 0) {
+ return ParseError::kParseNoError;
+ }
return gapi_->SetParamData(args.id, size, AddressAfterStruct(args));
}
@@ -613,6 +629,9 @@
if (face >= 6 || unused != 0 ||
size > data_size)
return BufferSyncInterface::kParseInvalidArguments;
+ if (data_size == 0) {
+ return ParseError::kParseNoError;
+ }
return gapi_->SetTextureData(
args.texture_id, x, y, z, width, height, depth, level,
static_cast<texture::Face>(face), args.row_pitch,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698