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

Issue 212018: Change command buffer client code to use structures.... (Closed)

Created:
11 years, 3 months ago by gman
Modified:
9 years, 7 months ago
Reviewers:
rlp, petersont
CC:
o3d-review_googlegroups.com
Visibility:
Public.

Description

Change command buffer client code to use structures. I didn't update the big_test although I'm happy to do that in another CL. I changed the CB renderer code to use this. The only place I didn't is the state handling code. I'll consider changing that in another CL. I changed DoCommand so it gets passed the entire command data including the command itself where as it used to get passed the command buffer entry after the command. I wanted to put the commands into the structures as I think it makes them easier to use since they can then correctly set their header. I could have left DoCommand as is but there would have been a lot of funky pointer math and I thought this change made it cleaner. Some questions I had while doing this. There are a few places in the code that use unsigned int instead of uint32. It seems we should use uint32 because unsigned int is not guarnteed to be 32bits. So for example ResourceID is unsigned int right now. The CMD::Set/CMD::Init/CommandBufferHelper commands are currently fairly untyped. For example DESTROY_TEXTURE takes a uint32 id. Should it take a ResourceID instead? DRAW should maybe take an enum for primitive_type? If we decide to do that I'd like to do it in another CL. There's no checking for overflow. We could add a bunch of DCHECK like DCHECK_LE(width, 65536) or DCHECK_LE(semantic_index, 16). I'd like to do those in another CL as well as I think we need to discuss what commands we want to change. All the code is in .h files because we want all of this code to inline. Theoretically this should be just as efficient as poking values into arrays in the opt builds.

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 9

Patch Set 5 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4532 lines, -1874 lines) Patch
M command_buffer/client/cross/big_test_client.cc View 5 chunks +53 lines, -161 lines 0 comments Download
M command_buffer/client/cross/buffer_sync_proxy_test.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M command_buffer/client/cross/cmd_buffer_helper.h View 1 2 3 4 2 chunks +621 lines, -1 line 0 comments Download
M command_buffer/client/cross/cmd_buffer_helper.cc View 1 2 3 4 4 chunks +14 lines, -7 lines 0 comments Download
M command_buffer/client/cross/cmd_buffer_helper_test.cc View 12 chunks +29 lines, -29 lines 0 comments Download
M command_buffer/client/cross/effect_helper.cc View 8 chunks +26 lines, -45 lines 0 comments Download
M command_buffer/client/cross/fenced_allocator_test.cc View 4 chunks +11 lines, -11 lines 0 comments Download
M command_buffer/common/cross/buffer_sync_api.h View 2 chunks +12 lines, -12 lines 0 comments Download
M command_buffer/common/cross/cmd_buffer_format.h View 1 2 3 4 16 chunks +2668 lines, -213 lines 0 comments Download
M command_buffer/common/cross/gapi_interface.h View 37 chunks +80 lines, -80 lines 0 comments Download
M command_buffer/common/cross/resource.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M command_buffer/samples/bubble/bubble_module.cc View 1 41 chunks +61 lines, -61 lines 0 comments Download
M command_buffer/service/cross/buffer_rpc_test.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M command_buffer/service/cross/cmd_buffer_engine.h View 1 chunk +2 lines, -2 lines 0 comments Download
M command_buffer/service/cross/cmd_buffer_engine.cc View 8 chunks +27 lines, -27 lines 0 comments Download
M command_buffer/service/cross/cmd_buffer_engine_test.cc View 27 chunks +40 lines, -40 lines 0 comments Download
M command_buffer/service/cross/cmd_parser.h View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M command_buffer/service/cross/cmd_parser.cc View 1 2 3 4 2 chunks +5 lines, -5 lines 0 comments Download
M command_buffer/service/cross/cmd_parser_test.cc View 10 chunks +23 lines, -23 lines 0 comments Download
M command_buffer/service/cross/effect_utils.h View 1 chunk +1 line, -1 line 0 comments Download
M command_buffer/service/cross/gapi_decoder.h View 1 2 3 4 3 chunks +3 lines, -49 lines 0 comments Download
M command_buffer/service/cross/gapi_decoder.cc View 1 2 3 4 9 chunks +414 lines, -536 lines 0 comments Download
M command_buffer/service/cross/gl/effect_gl.cc View 5 chunks +27 lines, -27 lines 0 comments Download
M command_buffer/service/cross/gl/geometry_gl.cc View 12 chunks +38 lines, -38 lines 0 comments Download
M command_buffer/service/cross/gl/sampler_gl.cc View 5 chunks +9 lines, -9 lines 0 comments Download
M command_buffer/service/cross/gl/texture_gl.cc View 6 chunks +14 lines, -14 lines 0 comments Download
M command_buffer/service/cross/mocks.h View 1 2 3 4 3 chunks +6 lines, -5 lines 0 comments Download
M command_buffer/service/win/d3d9/effect_d3d9.cc View 9 chunks +27 lines, -27 lines 0 comments Download
M command_buffer/service/win/d3d9/gapi_d3d9.cc View 3 chunks +12 lines, -12 lines 0 comments Download
M command_buffer/service/win/d3d9/geometry_d3d9.cc View 8 chunks +23 lines, -23 lines 0 comments Download
M command_buffer/service/win/d3d9/render_surface_d3d9.cc View 5 chunks +15 lines, -15 lines 0 comments Download
M command_buffer/service/win/d3d9/sampler_d3d9.cc View 5 chunks +9 lines, -9 lines 0 comments Download
M command_buffer/service/win/d3d9/texture_d3d9.cc View 6 chunks +14 lines, -14 lines 0 comments Download
M core/cross/command_buffer/buffer_cb.cc View 1 2 3 4 6 chunks +31 lines, -52 lines 0 comments Download
M core/cross/command_buffer/effect_cb.cc View 1 2 3 4 2 chunks +6 lines, -10 lines 0 comments Download
M core/cross/command_buffer/param_cache_cb.cc View 1 2 3 4 3 chunks +6 lines, -19 lines 0 comments Download
M core/cross/command_buffer/primitive_cb.cc View 1 2 3 4 2 chunks +4 lines, -13 lines 0 comments Download
M core/cross/command_buffer/render_surface_cb.cc View 1 2 3 4 3 chunks +7 lines, -23 lines 0 comments Download
M core/cross/command_buffer/renderer_cb.cc View 1 2 3 4 3 chunks +12 lines, -27 lines 0 comments Download
M core/cross/command_buffer/sampler_cb.cc View 1 2 3 4 4 chunks +17 lines, -25 lines 0 comments Download
M core/cross/command_buffer/states_cb.h View 1 chunk +20 lines, -18 lines 0 comments Download
M core/cross/command_buffer/states_cb.cc View 7 chunks +87 lines, -93 lines 0 comments Download
M core/cross/command_buffer/stream_bank_cb.cc View 1 2 3 4 4 chunks +11 lines, -22 lines 0 comments Download
M core/cross/command_buffer/texture_cb.cc View 1 2 3 4 7 chunks +36 lines, -66 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
gman
11 years, 3 months ago (2009-09-18 02:48:35 UTC) #1
petersont
I think this is a great improvement, but I confess I haven't read every single ...
11 years, 3 months ago (2009-09-18 22:02:34 UTC) #2
gman
I fixed those. Once we decide what to do about the bitfields (looks like we'll ...
11 years, 3 months ago (2009-09-19 02:52:55 UTC) #3
petersont
11 years, 3 months ago (2009-09-21 23:38:32 UTC) #4
There are still some lint errors, otherwise, LGTM.

The changes you suggested for future cls all sound righteous to me as well. 
Changing uint32 to ResourceID where appropriate seems like a good idea, as does
expanding bitfields that we think will need to be bigger one day when hardware
improves etc.

Powered by Google App Engine
This is Rietveld 408576698