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

Unified Diff: gpu/command_buffer/service/shader_translator.h

Issue 1273693002: command_buffer: Use GLSL core version that matches the OpenGL version (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix android compile problem and rebase Created 5 years, 4 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/mocks.h ('k') | gpu/command_buffer/service/shader_translator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/shader_translator.h
diff --git a/gpu/command_buffer/service/shader_translator.h b/gpu/command_buffer/service/shader_translator.h
index 858014dc0494fb9af555aa3027f705094448fdcf..6e7628ffa05f5900a153f3641650e14c27285a26 100644
--- a/gpu/command_buffer/service/shader_translator.h
+++ b/gpu/command_buffer/service/shader_translator.h
@@ -15,6 +15,10 @@
#include "gpu/gpu_export.h"
#include "third_party/angle/include/GLSLANG/ShaderLang.h"
+namespace gfx {
+struct GLVersionInfo;
+}
+
namespace gpu {
namespace gles2 {
@@ -31,19 +35,14 @@ class ShaderTranslatorInterface
: public base::RefCounted<ShaderTranslatorInterface> {
public:
ShaderTranslatorInterface() {}
- enum GlslImplementationType {
- kGlsl,
- kGlslES
- };
// Initializes the translator.
// Must be called once before using the translator object.
- virtual bool Init(
- sh::GLenum shader_type,
- ShShaderSpec shader_spec,
- const ShBuiltInResources* resources,
- GlslImplementationType glsl_implementation_type,
- ShCompileOptions driver_bug_workarounds) = 0;
+ virtual bool Init(sh::GLenum shader_type,
+ ShShaderSpec shader_spec,
+ const ShBuiltInResources* resources,
+ ShShaderOutput shader_output_language,
+ ShCompileOptions driver_bug_workarounds) = 0;
// Translates the given shader source.
// Returns true if translation is successful, false otherwise.
@@ -88,11 +87,15 @@ class GPU_EXPORT ShaderTranslator
ShaderTranslator();
+ // Return shader output lanaguage type based on the context version.
+ static ShShaderOutput GetShaderOutputLanguageForContext(
+ const gfx::GLVersionInfo& context_version);
+
// Overridden from ShaderTranslatorInterface.
bool Init(sh::GLenum shader_type,
ShShaderSpec shader_spec,
const ShBuiltInResources* resources,
- GlslImplementationType glsl_implementation_type,
+ ShShaderOutput shader_output_language,
ShCompileOptions driver_bug_workarounds) override;
// Overridden from ShaderTranslatorInterface.
@@ -116,7 +119,6 @@ class GPU_EXPORT ShaderTranslator
int GetCompileOptions() const;
ShHandle compiler_;
- bool implementation_is_glsl_es_;
ShCompileOptions driver_bug_workarounds_;
base::ObserverList<DestructionObserver> destruction_observers_;
};
« no previous file with comments | « gpu/command_buffer/service/mocks.h ('k') | gpu/command_buffer/service/shader_translator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698