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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc

Issue 2821363003: WebGL: tex(Sub)Image(2D|3D) texImageSource support for RGB10_A2 textures. (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h" 5 #include "gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 D_FORMAT_RGB9_E5, 67 D_FORMAT_RGB9_E5,
68 D_FORMAT_R16F, 68 D_FORMAT_R16F,
69 D_FORMAT_R32F, 69 D_FORMAT_R32F,
70 D_FORMAT_RG16F, 70 D_FORMAT_RG16F,
71 D_FORMAT_RG32F, 71 D_FORMAT_RG32F,
72 D_FORMAT_RGB16F, 72 D_FORMAT_RGB16F,
73 D_FORMAT_RGB32F, 73 D_FORMAT_RGB32F,
74 D_FORMAT_RGBA16F, 74 D_FORMAT_RGBA16F,
75 D_FORMAT_RGBA32F, 75 D_FORMAT_RGBA32F,
76 D_FORMAT_R11F_G11F_B10F, 76 D_FORMAT_R11F_G11F_B10F,
77 D_FORMAT_RGB10_A2,
77 NUM_D_FORMAT 78 NUM_D_FORMAT
78 }; 79 };
79 80
80 const unsigned kNumVertexShaders = NUM_SAMPLERS; 81 const unsigned kNumVertexShaders = NUM_SAMPLERS;
81 const unsigned kNumFragmentShaders = 82 const unsigned kNumFragmentShaders =
82 4 * NUM_SAMPLERS * NUM_S_FORMAT * NUM_D_FORMAT; 83 4 * NUM_SAMPLERS * NUM_S_FORMAT * NUM_D_FORMAT;
83 84
84 typedef unsigned ShaderId; 85 typedef unsigned ShaderId;
85 86
86 ShaderId GetVertexShaderId(GLenum target) { 87 ShaderId GetVertexShaderId(GLenum target) {
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 break; 263 break;
263 case GL_RGBA16F: 264 case GL_RGBA16F:
264 destFormatIndex = D_FORMAT_RGBA16F; 265 destFormatIndex = D_FORMAT_RGBA16F;
265 break; 266 break;
266 case GL_RGBA32F: 267 case GL_RGBA32F:
267 destFormatIndex = D_FORMAT_RGBA32F; 268 destFormatIndex = D_FORMAT_RGBA32F;
268 break; 269 break;
269 case GL_R11F_G11F_B10F: 270 case GL_R11F_G11F_B10F:
270 destFormatIndex = D_FORMAT_R11F_G11F_B10F; 271 destFormatIndex = D_FORMAT_R11F_G11F_B10F;
271 break; 272 break;
273 case GL_RGB10_A2:
274 destFormatIndex = D_FORMAT_RGB10_A2;
275 break;
272 default: 276 default:
273 NOTREACHED(); 277 NOTREACHED();
274 break; 278 break;
275 } 279 }
276 280
277 return alphaIndex + targetIndex * 4 + sourceFormatIndex * 4 * NUM_SAMPLERS + 281 return alphaIndex + targetIndex * 4 + sourceFormatIndex * 4 * NUM_SAMPLERS +
278 destFormatIndex * 4 * NUM_SAMPLERS * NUM_S_FORMAT; 282 destFormatIndex * 4 * NUM_SAMPLERS * NUM_S_FORMAT;
279 } 283 }
280 284
281 const char* kShaderPrecisionPreamble = 285 const char* kShaderPrecisionPreamble =
(...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after
1343 decoder->RestoreTextureUnitBindings(0); 1347 decoder->RestoreTextureUnitBindings(0);
1344 decoder->RestoreActiveTexture(); 1348 decoder->RestoreActiveTexture();
1345 decoder->RestoreProgramBindings(); 1349 decoder->RestoreProgramBindings();
1346 decoder->RestoreBufferBindings(); 1350 decoder->RestoreBufferBindings();
1347 decoder->RestoreFramebufferBindings(); 1351 decoder->RestoreFramebufferBindings();
1348 decoder->RestoreGlobalState(); 1352 decoder->RestoreGlobalState();
1349 } 1353 }
1350 1354
1351 } // namespace gles2 1355 } // namespace gles2
1352 } // namespace gpu 1356 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698