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

Side by Side Diff: core/cross/command_buffer/sampler_cb.cc

Issue 332036: move all O3D specific command buffer stuff to command_buffer::o3d... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: Created 11 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « core/cross/command_buffer/renderer_cb.cc ('k') | core/cross/command_buffer/states_cb.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2009, Google Inc. 2 * Copyright 2009, Google Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 18 matching lines...) Expand all
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32 32
33 // This file contains the implementation of the SamplerCB class. 33 // This file contains the implementation of the SamplerCB class.
34 34
35 #include "core/cross/precompile.h" 35 #include "core/cross/precompile.h"
36 #include "core/cross/error.h" 36 #include "core/cross/error.h"
37 #include "core/cross/command_buffer/sampler_cb.h" 37 #include "core/cross/command_buffer/sampler_cb.h"
38 #include "core/cross/command_buffer/renderer_cb.h" 38 #include "core/cross/command_buffer/renderer_cb.h"
39 #include "command_buffer/common/cross/cmd_buffer_format.h" 39 #include "command_buffer/common/cross/o3d_cmd_format.h"
40 #include "command_buffer/client/cross/o3d_cmd_helper.h" 40 #include "command_buffer/client/cross/o3d_cmd_helper.h"
41 41
42 namespace o3d { 42 namespace o3d {
43 43
44 using command_buffer::CommandBufferEntry; 44 using command_buffer::CommandBufferEntry;
45 using command_buffer::O3DCmdHelper; 45 using command_buffer::O3DCmdHelper;
46 using command_buffer::ResourceId; 46 using command_buffer::ResourceId;
47 namespace sampler = command_buffer::sampler; 47 namespace sampler = command_buffer::sampler;
48 48
49 namespace { 49 namespace {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 O3DCmdHelper* helper = renderer_->helper(); 97 O3DCmdHelper* helper = renderer_->helper();
98 sampler::AddressingMode address_mode_u_cb = AddressModeToCB(address_mode_u()); 98 sampler::AddressingMode address_mode_u_cb = AddressModeToCB(address_mode_u());
99 sampler::AddressingMode address_mode_v_cb = AddressModeToCB(address_mode_v()); 99 sampler::AddressingMode address_mode_v_cb = AddressModeToCB(address_mode_v());
100 sampler::AddressingMode address_mode_w_cb = AddressModeToCB(address_mode_w()); 100 sampler::AddressingMode address_mode_w_cb = AddressModeToCB(address_mode_w());
101 sampler::FilteringMode mag_filter_cb = FilterTypeToCB(mag_filter()); 101 sampler::FilteringMode mag_filter_cb = FilterTypeToCB(mag_filter());
102 sampler::FilteringMode min_filter_cb = FilterTypeToCB(min_filter()); 102 sampler::FilteringMode min_filter_cb = FilterTypeToCB(min_filter());
103 sampler::FilteringMode mip_filter_cb = FilterTypeToCB(mip_filter()); 103 sampler::FilteringMode mip_filter_cb = FilterTypeToCB(mip_filter());
104 if (mag_filter_cb == sampler::kNone) mag_filter_cb = sampler::kPoint; 104 if (mag_filter_cb == sampler::kNone) mag_filter_cb = sampler::kPoint;
105 if (min_filter_cb == sampler::kNone) min_filter_cb = sampler::kPoint; 105 if (min_filter_cb == sampler::kNone) min_filter_cb = sampler::kPoint;
106 int max_max_anisotropy = 106 int max_max_anisotropy =
107 command_buffer::cmd::SetSamplerStates::MaxAnisotropy::kMask; 107 command_buffer::o3d::SetSamplerStates::MaxAnisotropy::kMask;
108 unsigned int max_anisotropy_cb = 108 unsigned int max_anisotropy_cb =
109 std::max(1, std::min(max_max_anisotropy, max_anisotropy())); 109 std::max(1, std::min(max_max_anisotropy, max_anisotropy()));
110 if (min_filter() != Sampler::ANISOTROPIC) { 110 if (min_filter() != Sampler::ANISOTROPIC) {
111 max_anisotropy_cb = 1; 111 max_anisotropy_cb = 1;
112 } 112 }
113 helper->SetSamplerStates( 113 helper->SetSamplerStates(
114 resource_id_, 114 resource_id_,
115 address_mode_u_cb, 115 address_mode_u_cb,
116 address_mode_v_cb, 116 address_mode_v_cb,
117 address_mode_w_cb, 117 address_mode_w_cb,
(...skipping 17 matching lines...) Expand all
135 } 135 }
136 136
137 if (texture_object) { 137 if (texture_object) {
138 helper->SetSamplerTexture( 138 helper->SetSamplerTexture(
139 resource_id_, 139 resource_id_,
140 reinterpret_cast<uint32>(texture_object->GetTextureHandle())); 140 reinterpret_cast<uint32>(texture_object->GetTextureHandle()));
141 } 141 }
142 } 142 }
143 143
144 } // namespace o3d 144 } // namespace o3d
OLDNEW
« no previous file with comments | « core/cross/command_buffer/renderer_cb.cc ('k') | core/cross/command_buffer/states_cb.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698