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

Side by Side Diff: gpu/command_buffer/service/context_state.h

Issue 2503403003: ES3 sampler types and their corresponding textures should be initialized before being sampled. (Closed)
Patch Set: Created 4 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
« 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 // This file contains the ContextState class. 5 // This file contains the ContextState class.
6 6
7 #ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ 7 #ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_
8 #define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ 8 #define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_
9 9
10 #include <memory> 10 #include <memory>
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 scoped_refptr<TextureRef> bound_texture_3d; 61 scoped_refptr<TextureRef> bound_texture_3d;
62 62
63 // texture currently bound to this unit's GL_TEXTURE_2D_ARRAY with 63 // texture currently bound to this unit's GL_TEXTURE_2D_ARRAY with
64 // glBindTexture 64 // glBindTexture
65 scoped_refptr<TextureRef> bound_texture_2d_array; 65 scoped_refptr<TextureRef> bound_texture_2d_array;
66 66
67 scoped_refptr<TextureRef> GetInfoForSamplerType( 67 scoped_refptr<TextureRef> GetInfoForSamplerType(
68 GLenum type) { 68 GLenum type) {
69 switch (type) { 69 switch (type) {
70 case GL_SAMPLER_2D: 70 case GL_SAMPLER_2D:
71 case GL_SAMPLER_2D_SHADOW:
72 case GL_INT_SAMPLER_2D:
73 case GL_UNSIGNED_INT_SAMPLER_2D:
71 return bound_texture_2d; 74 return bound_texture_2d;
72 case GL_SAMPLER_CUBE: 75 case GL_SAMPLER_CUBE:
76 case GL_SAMPLER_CUBE_SHADOW:
77 case GL_INT_SAMPLER_CUBE:
78 case GL_UNSIGNED_INT_SAMPLER_CUBE:
73 return bound_texture_cube_map; 79 return bound_texture_cube_map;
74 case GL_SAMPLER_EXTERNAL_OES: 80 case GL_SAMPLER_EXTERNAL_OES:
75 return bound_texture_external_oes; 81 return bound_texture_external_oes;
76 case GL_SAMPLER_2D_RECT_ARB: 82 case GL_SAMPLER_2D_RECT_ARB:
77 return bound_texture_rectangle_arb; 83 return bound_texture_rectangle_arb;
78 case GL_SAMPLER_3D: 84 case GL_SAMPLER_3D:
85 case GL_INT_SAMPLER_3D:
86 case GL_UNSIGNED_INT_SAMPLER_3D:
79 return bound_texture_3d; 87 return bound_texture_3d;
80 case GL_SAMPLER_2D_ARRAY: 88 case GL_SAMPLER_2D_ARRAY:
89 case GL_SAMPLER_2D_ARRAY_SHADOW:
90 case GL_INT_SAMPLER_2D_ARRAY:
91 case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
81 return bound_texture_2d_array; 92 return bound_texture_2d_array;
82 } 93 }
83 94
84 NOTREACHED(); 95 NOTREACHED();
85 return NULL; 96 return nullptr;
86 } 97 }
87 98
88 scoped_refptr<TextureRef>& GetInfoForTarget(GLenum target) { 99 scoped_refptr<TextureRef>& GetInfoForTarget(GLenum target) {
89 switch (target) { 100 switch (target) {
90 case GL_TEXTURE_2D: 101 case GL_TEXTURE_2D:
91 return bound_texture_2d; 102 return bound_texture_2d;
92 case GL_TEXTURE_CUBE_MAP: 103 case GL_TEXTURE_CUBE_MAP:
93 return bound_texture_cube_map; 104 return bound_texture_cube_map;
94 case GL_TEXTURE_EXTERNAL_OES: 105 case GL_TEXTURE_EXTERNAL_OES:
95 return bound_texture_external_oes; 106 return bound_texture_external_oes;
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 GLfloat line_width_max_ = 1.0f; 366 GLfloat line_width_max_ = 1.0f;
356 367
357 FeatureInfo* feature_info_; 368 FeatureInfo* feature_info_;
358 std::unique_ptr<ErrorState> error_state_; 369 std::unique_ptr<ErrorState> error_state_;
359 }; 370 };
360 371
361 } // namespace gles2 372 } // namespace gles2
362 } // namespace gpu 373 } // namespace gpu
363 374
364 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_ 375 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_STATE_H_
365
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