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

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

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
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_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <stdio.h> 10 #include <stdio.h>
(...skipping 1880 matching lines...) Expand 10 before | Expand all | Expand 10 after
1891 GLsizei primcount); 1891 GLsizei primcount);
1892 error::Error DoDrawElements(const char* function_name, 1892 error::Error DoDrawElements(const char* function_name,
1893 bool instanced, 1893 bool instanced,
1894 GLenum mode, 1894 GLenum mode,
1895 GLsizei count, 1895 GLsizei count,
1896 GLenum type, 1896 GLenum type,
1897 int32_t offset, 1897 int32_t offset,
1898 GLsizei primcount); 1898 GLsizei primcount);
1899 1899
1900 GLenum GetBindTargetForSamplerType(GLenum type) { 1900 GLenum GetBindTargetForSamplerType(GLenum type) {
1901 DCHECK(type == GL_SAMPLER_2D || type == GL_SAMPLER_CUBE ||
1902 type == GL_SAMPLER_EXTERNAL_OES || type == GL_SAMPLER_2D_RECT_ARB);
1903 switch (type) { 1901 switch (type) {
1904 case GL_SAMPLER_2D: 1902 case GL_SAMPLER_2D:
1903 case GL_SAMPLER_2D_SHADOW:
1904 case GL_INT_SAMPLER_2D:
1905 case GL_UNSIGNED_INT_SAMPLER_2D:
1905 return GL_TEXTURE_2D; 1906 return GL_TEXTURE_2D;
1906 case GL_SAMPLER_CUBE: 1907 case GL_SAMPLER_CUBE:
1908 case GL_SAMPLER_CUBE_SHADOW:
1909 case GL_INT_SAMPLER_CUBE:
1910 case GL_UNSIGNED_INT_SAMPLER_CUBE:
1907 return GL_TEXTURE_CUBE_MAP; 1911 return GL_TEXTURE_CUBE_MAP;
1908 case GL_SAMPLER_EXTERNAL_OES: 1912 case GL_SAMPLER_EXTERNAL_OES:
1909 return GL_TEXTURE_EXTERNAL_OES; 1913 return GL_TEXTURE_EXTERNAL_OES;
1910 case GL_SAMPLER_2D_RECT_ARB: 1914 case GL_SAMPLER_2D_RECT_ARB:
1911 return GL_TEXTURE_RECTANGLE_ARB; 1915 return GL_TEXTURE_RECTANGLE_ARB;
1916 case GL_SAMPLER_3D:
1917 case GL_INT_SAMPLER_3D:
1918 case GL_UNSIGNED_INT_SAMPLER_3D:
1919 return GL_TEXTURE_3D;
1920 case GL_SAMPLER_2D_ARRAY:
1921 case GL_SAMPLER_2D_ARRAY_SHADOW:
1922 case GL_INT_SAMPLER_2D_ARRAY:
1923 case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
1924 return GL_TEXTURE_2D_ARRAY;
1925 default:
1926 NOTREACHED();
1927 return 0;
1912 } 1928 }
1913
1914 NOTREACHED();
1915 return 0;
1916 } 1929 }
1917 1930
1918 // Gets the framebuffer info for a particular target. 1931 // Gets the framebuffer info for a particular target.
1919 Framebuffer* GetFramebufferInfoForTarget(GLenum target) { 1932 Framebuffer* GetFramebufferInfoForTarget(GLenum target) {
1920 Framebuffer* framebuffer = NULL; 1933 Framebuffer* framebuffer = NULL;
1921 switch (target) { 1934 switch (target) {
1922 case GL_FRAMEBUFFER: 1935 case GL_FRAMEBUFFER:
1923 case GL_DRAW_FRAMEBUFFER_EXT: 1936 case GL_DRAW_FRAMEBUFFER_EXT:
1924 framebuffer = framebuffer_state_.bound_draw_framebuffer.get(); 1937 framebuffer = framebuffer_state_.bound_draw_framebuffer.get();
1925 break; 1938 break;
(...skipping 16926 matching lines...) Expand 10 before | Expand all | Expand 10 after
18852 } 18865 }
18853 18866
18854 // Include the auto-generated part of this file. We split this because it means 18867 // Include the auto-generated part of this file. We split this because it means
18855 // we can easily edit the non-auto generated parts right here in this file 18868 // we can easily edit the non-auto generated parts right here in this file
18856 // instead of having to edit some template or the code generator. 18869 // instead of having to edit some template or the code generator.
18857 #include "base/macros.h" 18870 #include "base/macros.h"
18858 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 18871 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
18859 18872
18860 } // namespace gles2 18873 } // namespace gles2
18861 } // namespace gpu 18874 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/context_state.h ('k') | gpu/command_buffer/service/program_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698