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

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

Issue 872713004: Add glTransformFeedbackVaryings to GPU command buffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@caritas
Patch Set: Created 5 years, 11 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 is auto-generated from 5 // This file is auto-generated from
6 // gpu/command_buffer/build_gles2_cmd_buffer.py 6 // gpu/command_buffer/build_gles2_cmd_buffer.py
7 // It's formatted by clang-format using chromium coding style: 7 // It's formatted by clang-format using chromium coding style:
8 // clang-format -i -style=chromium filename 8 // clang-format -i -style=chromium filename
9 // DO NOT EDIT! 9 // DO NOT EDIT!
10 10
(...skipping 2801 matching lines...) Expand 10 before | Expand all | Expand 10 after
2812 return error::kNoError; 2812 return error::kNoError;
2813 } 2813 }
2814 if (depth < 0) { 2814 if (depth < 0) {
2815 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glTexStorage3D", "depth < 0"); 2815 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glTexStorage3D", "depth < 0");
2816 return error::kNoError; 2816 return error::kNoError;
2817 } 2817 }
2818 glTexStorage3D(target, levels, internalFormat, width, height, depth); 2818 glTexStorage3D(target, levels, internalFormat, width, height, depth);
2819 return error::kNoError; 2819 return error::kNoError;
2820 } 2820 }
2821 2821
2822 error::Error GLES2DecoderImpl::HandleTransformFeedbackVaryingsBucket(
2823 uint32_t immediate_data_size,
2824 const void* cmd_data) {
2825 if (!unsafe_es3_apis_enabled())
2826 return error::kUnknownCommand;
2827 const gles2::cmds::TransformFeedbackVaryingsBucket& c =
2828 *static_cast<const gles2::cmds::TransformFeedbackVaryingsBucket*>(
2829 cmd_data);
2830 (void)c;
2831 GLuint program = static_cast<GLuint>(c.program);
2832
2833 const size_t kMinBucketSize = sizeof(GLint);
2834 // Each string has at least |length| in the header and a NUL character.
2835 const size_t kMinStringSize = sizeof(GLint) + 1;
2836 Bucket* bucket = GetBucket(c.varyings_bucket_id);
2837 if (!bucket) {
2838 return error::kInvalidArguments;
2839 }
2840 const size_t bucket_size = bucket->size();
2841 if (bucket_size < kMinBucketSize) {
2842 return error::kInvalidArguments;
2843 }
2844 const char* bucket_data = bucket->GetDataAs<const char*>(0, bucket_size);
2845 const GLint* header = reinterpret_cast<const GLint*>(bucket_data);
2846 GLsizei count = static_cast<GLsizei>(header[0]);
2847 if (count < 0) {
2848 return error::kInvalidArguments;
2849 }
2850 const size_t max_count = (bucket_size - kMinBucketSize) / kMinStringSize;
2851 if (max_count < static_cast<size_t>(count)) {
2852 return error::kInvalidArguments;
2853 }
2854 const GLint* length = header + 1;
2855 scoped_ptr<const char* []> strs;
2856 if (count > 0)
2857 strs.reset(new const char* [count]);
2858 const char** varyings = strs.get();
2859 base::CheckedNumeric<size_t> total_size = sizeof(GLint);
2860 total_size *= count + 1; // Header size.
2861 if (!total_size.IsValid())
2862 return error::kInvalidArguments;
2863 for (GLsizei ii = 0; ii < count; ++ii) {
2864 varyings[ii] = bucket_data + total_size.ValueOrDefault(0);
2865 total_size += length[ii];
2866 total_size += 1; // NUL char at the end of each char array.
2867 if (!total_size.IsValid() || total_size.ValueOrDefault(0) > bucket_size ||
2868 varyings[ii][length[ii]] != 0) {
2869 return error::kInvalidArguments;
2870 }
2871 }
2872 if (total_size.ValueOrDefault(0) != bucket_size) {
2873 return error::kInvalidArguments;
2874 }
2875 GLenum buffermode = static_cast<GLenum>(c.buffermode);
2876 DoTransformFeedbackVaryings(program, count, varyings, buffermode);
2877 return error::kNoError;
2878 }
2879
2822 error::Error GLES2DecoderImpl::HandleUniform1f(uint32_t immediate_data_size, 2880 error::Error GLES2DecoderImpl::HandleUniform1f(uint32_t immediate_data_size,
2823 const void* cmd_data) { 2881 const void* cmd_data) {
2824 const gles2::cmds::Uniform1f& c = 2882 const gles2::cmds::Uniform1f& c =
2825 *static_cast<const gles2::cmds::Uniform1f*>(cmd_data); 2883 *static_cast<const gles2::cmds::Uniform1f*>(cmd_data);
2826 (void)c; 2884 (void)c;
2827 GLint location = static_cast<GLint>(c.location); 2885 GLint location = static_cast<GLint>(c.location);
2828 GLfloat x = static_cast<GLfloat>(c.x); 2886 GLfloat x = static_cast<GLfloat>(c.x);
2829 GLfloat temp[1] = { 2887 GLfloat temp[1] = {
2830 x, 2888 x,
2831 }; 2889 };
(...skipping 1996 matching lines...) Expand 10 before | Expand all | Expand 10 after
4828 state_.ignore_cached_state) { 4886 state_.ignore_cached_state) {
4829 framebuffer_state_.clear_state_dirty = true; 4887 framebuffer_state_.clear_state_dirty = true;
4830 } 4888 }
4831 return false; 4889 return false;
4832 default: 4890 default:
4833 NOTREACHED(); 4891 NOTREACHED();
4834 return false; 4892 return false;
4835 } 4893 }
4836 } 4894 }
4837 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_ 4895 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_AUTOGEN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698