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

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

Issue 2152733003: gpu_fuzzer: cache shader translators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_mock.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 eecf5a2155fcbcf20b85167678816c728bf4d713..4cd19e2e0ebd694febff9dfd0049a73c9fed971a 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -655,6 +655,7 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
ErrorState* GetErrorState() override;
const ContextState* GetContextState() override { return &state_; }
+ scoped_refptr<ShaderTranslatorInterface> GetTranslator(GLenum type) override;
void SetShaderCacheCallback(const ShaderCacheCallback& callback) override;
void SetFenceSyncReleaseCallback(
@@ -9323,6 +9324,11 @@ void GLES2DecoderImpl::DoTransformFeedbackVaryings(
program->TransformFeedbackVaryings(count, varyings, buffer_mode);
}
+scoped_refptr<ShaderTranslatorInterface> GLES2DecoderImpl::GetTranslator(
+ GLenum type) {
+ return type == GL_VERTEX_SHADER ? vertex_translator_ : fragment_translator_;
+}
+
void GLES2DecoderImpl::DoCompileShader(GLuint client_id) {
TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoCompileShader");
Shader* shader = GetShaderInfoNotProgram(client_id, "glCompileShader");
@@ -9331,10 +9337,8 @@ void GLES2DecoderImpl::DoCompileShader(GLuint client_id) {
}
scoped_refptr<ShaderTranslatorInterface> translator;
- if (!feature_info_->disable_shader_translator()) {
- translator = shader->shader_type() == GL_VERTEX_SHADER ?
- vertex_translator_ : fragment_translator_;
- }
+ if (!feature_info_->disable_shader_translator())
+ translator = GetTranslator(shader->shader_type());
const Shader::TranslatedShaderSourceType source_type =
feature_info_->feature_flags().angle_translated_shader_source ?
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698