diff options
author | alokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-06 20:06:01 +0000 |
---|---|---|
committer | alokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-06 20:06:01 +0000 |
commit | a64c6e69516128197c29740077aa10f637e500b1 (patch) | |
tree | e61c3dc103142a04b37ca845c00fe698cd6867ce /gpu/command_buffer | |
parent | 23e040a98019974f182caf3183ae8f0654122fc7 (diff) | |
download | chromium_src-a64c6e69516128197c29740077aa10f637e500b1.zip chromium_src-a64c6e69516128197c29740077aa10f637e500b1.tar.gz chromium_src-a64c6e69516128197c29740077aa10f637e500b1.tar.bz2 |
Rolled ANGLE rev 441:443. Other changes to accomodate the new ANGLE API.
Review URL: http://codereview.chromium.org/3563006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61697 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer')
4 files changed, 16 insertions, 16 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index a09c6ce..8994d4e 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -1906,8 +1906,8 @@ bool GLES2DecoderImpl::Initialize(gfx::GLContext* context, } if (use_shader_translator_) { - TBuiltInResource resources; - ShInitBuiltInResource(&resources); + ShBuiltInResources resources; + ShInitBuiltInResources(&resources); resources.MaxVertexAttribs = group_->max_vertex_attribs(); resources.MaxVertexUniformVectors = group_->max_vertex_uniform_vectors(); @@ -1922,13 +1922,13 @@ bool GLES2DecoderImpl::Initialize(gfx::GLContext* context, resources.OES_standard_derivatives = feature_info_->feature_flags().oes_standard_derivatives ? 1 : 0; vertex_translator_.reset(new ShaderTranslator); - if (!vertex_translator_->Init(EShLangVertex, &resources)) { + if (!vertex_translator_->Init(SH_VERTEX_SHADER, &resources)) { LOG(ERROR) << "Could not initialize vertex shader translator."; Destroy(); return false; } fragment_translator_.reset(new ShaderTranslator); - if (!fragment_translator_->Init(EShLangFragment, &resources)) { + if (!fragment_translator_->Init(SH_FRAGMENT_SHADER, &resources)) { LOG(ERROR) << "Could not initialize fragment shader translator."; Destroy(); return false; diff --git a/gpu/command_buffer/service/shader_translator.cc b/gpu/command_buffer/service/shader_translator.cc index f64fd58..e1ebcbd 100644 --- a/gpu/command_buffer/service/shader_translator.cc +++ b/gpu/command_buffer/service/shader_translator.cc @@ -22,7 +22,7 @@ bool InitializeShaderTranslator() { } using gpu::gles2::ShaderTranslator; -void GetVariableInfo(ShHandle compiler, EShInfo var_type, +void GetVariableInfo(ShHandle compiler, ShShaderInfo var_type, ShaderTranslator::VariableMap* var_map) { int name_len = 0; switch (var_type) { @@ -41,7 +41,7 @@ void GetVariableInfo(ShHandle compiler, EShInfo var_type, ShGetInfo(compiler, var_type, &num_vars); for (int i = 0; i < num_vars; ++i) { int size = 0; - EShDataType type = SH_NONE; + ShDataType type = SH_NONE; switch (var_type) { case SH_ACTIVE_ATTRIBUTES: @@ -72,17 +72,17 @@ ShaderTranslator::~ShaderTranslator() { ShDestruct(compiler_); } -bool ShaderTranslator::Init(EShLanguage language, - const TBuiltInResource* resources) { +bool ShaderTranslator::Init(ShShaderType shader_type, + const ShBuiltInResources* resources) { // Make sure Init is called only once. DCHECK(compiler_ == NULL); - DCHECK(language == EShLangVertex || language == EShLangFragment); + DCHECK(shader_type == SH_FRAGMENT_SHADER || shader_type == SH_VERTEX_SHADER); DCHECK(resources != NULL); if (!InitializeShaderTranslator()) return false; - compiler_ = ShConstructCompiler(language, EShSpecGLES2, resources); + compiler_ = ShConstructCompiler(shader_type, SH_GLES2_SPEC, resources); return compiler_ != NULL; } @@ -93,7 +93,7 @@ bool ShaderTranslator::Translate(const char* shader) { ClearResults(); bool success = false; - int compile_options = EShOptObjectCode | EShOptAttribsUniforms; + int compile_options = SH_OBJECT_CODE | SH_ATTRIBUTES_UNIFORMS; if (ShCompile(compiler_, &shader, 1, compile_options)) { success = true; // Get translated shader. diff --git a/gpu/command_buffer/service/shader_translator.h b/gpu/command_buffer/service/shader_translator.h index 26e8dc6..e2e0620 100644 --- a/gpu/command_buffer/service/shader_translator.h +++ b/gpu/command_buffer/service/shader_translator.h @@ -23,7 +23,7 @@ class ShaderTranslator { // Initializes the translator. // Must be called once before using the translator object. - bool Init(EShLanguage language, const TBuiltInResource* resources); + bool Init(ShShaderType shader_type, const ShBuiltInResources* resources); // Translates the given shader source. // Returns true if translation is successful, false otherwise. bool Translate(const char* shader); diff --git a/gpu/command_buffer/service/shader_translator_unittest.cc b/gpu/command_buffer/service/shader_translator_unittest.cc index 251b95c..0e00944 100644 --- a/gpu/command_buffer/service/shader_translator_unittest.cc +++ b/gpu/command_buffer/service/shader_translator_unittest.cc @@ -18,11 +18,11 @@ class ShaderTranslatorTest : public testing::Test { protected: virtual void SetUp() { - TBuiltInResource resources; - ShInitBuiltInResource(&resources); + ShBuiltInResources resources; + ShInitBuiltInResources(&resources); - ASSERT_TRUE(vertex_translator_.Init(EShLangVertex, &resources)); - ASSERT_TRUE(fragment_translator_.Init(EShLangFragment, &resources)); + ASSERT_TRUE(vertex_translator_.Init(SH_VERTEX_SHADER, &resources)); + ASSERT_TRUE(fragment_translator_.Init(SH_FRAGMENT_SHADER, &resources)); // Post-init the results must be empty. // Vertex translator results. EXPECT_TRUE(vertex_translator_.translated_shader() == NULL); |