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

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

Issue 1309743005: command_buffer: Implement EXT_blend_func_extended (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@new-05-path-fragment-input-gen
Patch Set: ~ 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
Index: gpu/command_buffer/service/shader_translator.cc
diff --git a/gpu/command_buffer/service/shader_translator.cc b/gpu/command_buffer/service/shader_translator.cc
index b852d2aa929cb2aa928a7e04d4d67517f141ab4c..616f95af819f720b98c9e603ae1b3840b6aa7f32 100644
--- a/gpu/command_buffer/service/shader_translator.cc
+++ b/gpu/command_buffer/service/shader_translator.cc
@@ -71,6 +71,11 @@ void GetVaryings(ShHandle compiler, VaryingMap* var_map) {
(*var_map)[(*varyings)[ii].mappedName] = (*varyings)[ii];
}
}
+void GetOutputVariables(ShHandle compiler, AttributeList* var_list) {
+ if (!var_list)
+ return;
+ *var_list = *ShGetOutputVariables(compiler);
+}
void GetNameHashingInfo(ShHandle compiler, NameMap* name_map) {
if (!name_map)
@@ -160,7 +165,6 @@ bool ShaderTranslator::Init(GLenum shader_type,
g_translator_initializer.Get();
-
{
TRACE_EVENT0("gpu", "ShConstructCompiler");
compiler_ = ShConstructCompiler(shader_type, shader_spec,
@@ -192,6 +196,7 @@ bool ShaderTranslator::Translate(const std::string& shader_source,
AttributeMap* attrib_map,
UniformMap* uniform_map,
VaryingMap* varying_map,
+ AttributeList* output_variable_list,
NameMap* name_map) const {
// Make sure this instance is initialized.
DCHECK(compiler_ != NULL);
@@ -210,10 +215,11 @@ bool ShaderTranslator::Translate(const std::string& shader_source,
}
// Get shader version.
*shader_version = ShGetShaderVersion(compiler_);
- // Get info for attribs, uniforms, and varyings.
+ // Get info for attribs, uniforms, varyings and output variables.
GetAttributes(compiler_, attrib_map);
GetUniforms(compiler_, uniform_map);
GetVaryings(compiler_, varying_map);
+ GetOutputVariables(compiler_, output_variable_list);
// Get info for name hashing.
GetNameHashingInfo(compiler_, name_map);
}

Powered by Google App Engine
This is Rietveld 408576698