 Chromium Code Reviews
 Chromium Code Reviews Issue 2121043002:
  16 bpp video stream capture, render and WebGL usage - Realsense R200 & SR300 support. 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 2121043002:
  16 bpp video stream capture, render and WebGL usage - Realsense R200 & SR300 support. 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| Index: gpu/command_buffer/service/gles2_cmd_decoder.cc | 
| diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc | 
| index 68b894846bb0ff89ffbdd837869f1f4f0492aaf6..ada08a2ecd3f3127533cff7555360c1f5db7b4a3 100644 | 
| --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc | 
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc | 
| @@ -10596,6 +10596,12 @@ error::Error GLES2DecoderImpl::HandleReadPixels(uint32_t immediate_data_size, | 
| accepted_formats.push_back(GL_RGBA); | 
| accepted_types.push_back(GL_UNSIGNED_INT_2_10_10_10_REV); | 
| break; | 
| + case GL_R32F: | 
| + if (validators_->read_pixel_format.IsValid(GL_RED)) { | 
| + accepted_formats.push_back(GL_RED); | 
| + accepted_types.push_back(GL_FLOAT); | 
| 
Ken Russell (switch to Gerrit)
2016/09/30 23:01:29
Where is it specified that ReadPixels with type GL
 | 
| + } | 
| + // Fall through. | 
| default: | 
| accepted_formats.push_back(GL_RGBA); | 
| { | 
| @@ -15015,7 +15021,10 @@ bool GLES2DecoderImpl::ValidateCopyTextureCHROMIUMInternalFormats( | 
| dest_internal_format == GL_RGB || dest_internal_format == GL_RGBA || | 
| dest_internal_format == GL_RGB8 || dest_internal_format == GL_RGBA8 || | 
| dest_internal_format == GL_BGRA_EXT || | 
| - dest_internal_format == GL_BGRA8_EXT; | 
| + dest_internal_format == GL_BGRA8_EXT || | 
| + ((dest_internal_format == GL_R16UI || dest_internal_format == GL_R8 || | 
| + dest_internal_format == GL_RG8) && | 
| + feature_info_->feature_flags().ext_texture_rg); | 
| 
Ken Russell (switch to Gerrit)
2016/09/30 23:01:30
EXT_texture_rg doesn't provide the GL_R16UI format
 | 
| bool valid_source_format = | 
| source_internal_format == GL_RED || source_internal_format == GL_ALPHA || | 
| source_internal_format == GL_RGB || source_internal_format == GL_RGBA || | 
| @@ -15025,7 +15034,18 @@ bool GLES2DecoderImpl::ValidateCopyTextureCHROMIUMInternalFormats( | 
| source_internal_format == GL_BGRA_EXT || | 
| source_internal_format == GL_BGRA8_EXT || | 
| source_internal_format == GL_RGB_YCBCR_420V_CHROMIUM || | 
| - source_internal_format == GL_RGB_YCBCR_422_CHROMIUM; | 
| + source_internal_format == GL_RGB_YCBCR_422_CHROMIUM || | 
| + source_internal_format == GL_RG_EXT || | 
| 
Ken Russell (switch to Gerrit)
2016/09/30 23:01:29
Why is support for GL_RG_EXT here not gated by fea
 | 
| + ((source_internal_format == GL_R32F || | 
| + source_internal_format == GL_R16F) && | 
| + validators_->texture_internal_format.IsValid(source_internal_format)); | 
| 
Ken Russell (switch to Gerrit)
2016/09/30 23:01:30
Why does this check of source_internal_format agai
 | 
| + | 
| + // TODO(astojilj): to check if renderable, check ext_color_buffer_(half)float. | 
| + // It is, for now, checked in Extensions3DUtil::canUseCopyTextureCHROMIUM. | 
| 
Ken Russell (switch to Gerrit)
2016/09/30 23:01:30
This is a pretty significant TODO. Could you pleas
 | 
| + if (dest_internal_format == GL_R32F || dest_internal_format == GL_R16F) | 
| + valid_dest_format = | 
| + validators_->texture_internal_format.IsValid(dest_internal_format); | 
| 
Ken Russell (switch to Gerrit)
2016/09/30 23:01:30
Why is this logic separate from the computation of
 | 
| + | 
| if (!valid_source_format) { | 
| std::string msg = "invalid source internal format " + | 
| GLES2Util::GetStringEnum(source_internal_format); | 
| @@ -15104,8 +15124,10 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM( | 
| TextureRef* source_texture_ref = GetTexture(source_id); | 
| TextureRef* dest_texture_ref = GetTexture(dest_id); | 
| + GLenum format = | 
| + TextureManager::ExtractFormatFromStorageFormat(internal_format); | 
| if (!texture_manager()->ValidateTextureParameters( | 
| - GetErrorState(), kFunctionName, true, internal_format, dest_type, | 
| + GetErrorState(), kFunctionName, true, format, dest_type, | 
| internal_format, 0)) | 
| return; |