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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc

Issue 2532543002: Implement GetTranslatedShaderSource in the passthrough cmd decoder. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc
index 418388c9404ff38aa00e595d7d7ec92b21817e01..05b23631cca6a2b87246cbb36798fb885a790dc9 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc
@@ -2594,7 +2594,21 @@ error::Error GLES2DecoderPassthroughImpl::DoGetUniformsES3CHROMIUM(
error::Error GLES2DecoderPassthroughImpl::DoGetTranslatedShaderSourceANGLE(
GLuint shader,
std::string* source) {
- NOTIMPLEMENTED();
+ FlushErrors();
+ GLuint service_id = GetShaderServiceID(shader, resources_);
+ GLint translated_source_length = 0;
+ glGetShaderiv(service_id, GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE,
+ &translated_source_length);
+ if (FlushErrors()) {
+ return error::kNoError;
+ }
+
+ if (translated_source_length > 0) {
+ std::vector<char> buffer(translated_source_length, 0);
+ glGetTranslatedShaderSourceANGLE(service_id, translated_source_length,
+ nullptr, buffer.data());
+ *source = std::string(buffer.data());
+ }
return error::kNoError;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698