|
@@ -132,6 +132,7 @@ const char *ShaderLanguage::token_names[TK_MAX] = {
|
|
"TYPE_ISAMPLER3D",
|
|
"TYPE_ISAMPLER3D",
|
|
"TYPE_USAMPLER3D",
|
|
"TYPE_USAMPLER3D",
|
|
"TYPE_SAMPLERCUBE",
|
|
"TYPE_SAMPLERCUBE",
|
|
|
|
+ "TYPE_SAMPLEREXT",
|
|
"INTERPOLATION_FLAT",
|
|
"INTERPOLATION_FLAT",
|
|
"INTERPOLATION_SMOOTH",
|
|
"INTERPOLATION_SMOOTH",
|
|
"CONST",
|
|
"CONST",
|
|
@@ -272,6 +273,7 @@ const ShaderLanguage::KeyWord ShaderLanguage::keyword_list[] = {
|
|
{ TK_TYPE_ISAMPLER3D, "isampler3D" },
|
|
{ TK_TYPE_ISAMPLER3D, "isampler3D" },
|
|
{ TK_TYPE_USAMPLER3D, "usampler3D" },
|
|
{ TK_TYPE_USAMPLER3D, "usampler3D" },
|
|
{ TK_TYPE_SAMPLERCUBE, "samplerCube" },
|
|
{ TK_TYPE_SAMPLERCUBE, "samplerCube" },
|
|
|
|
+ { TK_TYPE_SAMPLEREXT, "samplerExternalOES" },
|
|
{ TK_INTERPOLATION_FLAT, "flat" },
|
|
{ TK_INTERPOLATION_FLAT, "flat" },
|
|
{ TK_INTERPOLATION_SMOOTH, "smooth" },
|
|
{ TK_INTERPOLATION_SMOOTH, "smooth" },
|
|
{ TK_CONST, "const" },
|
|
{ TK_CONST, "const" },
|
|
@@ -755,7 +757,8 @@ bool ShaderLanguage::is_token_datatype(TokenType p_type) {
|
|
p_type == TK_TYPE_SAMPLER3D ||
|
|
p_type == TK_TYPE_SAMPLER3D ||
|
|
p_type == TK_TYPE_ISAMPLER3D ||
|
|
p_type == TK_TYPE_ISAMPLER3D ||
|
|
p_type == TK_TYPE_USAMPLER3D ||
|
|
p_type == TK_TYPE_USAMPLER3D ||
|
|
- p_type == TK_TYPE_SAMPLERCUBE);
|
|
|
|
|
|
+ p_type == TK_TYPE_SAMPLERCUBE ||
|
|
|
|
+ p_type == TK_TYPE_SAMPLEREXT);
|
|
}
|
|
}
|
|
|
|
|
|
ShaderLanguage::DataType ShaderLanguage::get_token_datatype(TokenType p_type) {
|
|
ShaderLanguage::DataType ShaderLanguage::get_token_datatype(TokenType p_type) {
|
|
@@ -841,6 +844,7 @@ String ShaderLanguage::get_datatype_name(DataType p_type) {
|
|
case TYPE_ISAMPLER3D: return "isampler3D";
|
|
case TYPE_ISAMPLER3D: return "isampler3D";
|
|
case TYPE_USAMPLER3D: return "usampler3D";
|
|
case TYPE_USAMPLER3D: return "usampler3D";
|
|
case TYPE_SAMPLERCUBE: return "samplerCube";
|
|
case TYPE_SAMPLERCUBE: return "samplerCube";
|
|
|
|
+ case TYPE_SAMPLEREXT: return "samplerExternalOES";
|
|
}
|
|
}
|
|
|
|
|
|
return "";
|
|
return "";
|
|
@@ -1983,6 +1987,8 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::builtin_func_defs[] = {
|
|
{ "texture", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true },
|
|
{ "texture", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true },
|
|
{ "texture", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false },
|
|
{ "texture", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, false },
|
|
{ "texture", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false },
|
|
{ "texture", TYPE_VEC4, { TYPE_SAMPLERCUBE, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false },
|
|
|
|
+ { "texture", TYPE_VEC4, { TYPE_SAMPLEREXT, TYPE_VEC2, TYPE_VOID }, TAG_GLOBAL, false },
|
|
|
|
+ { "texture", TYPE_VEC4, { TYPE_SAMPLEREXT, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false },
|
|
|
|
|
|
{ "textureProj", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, true },
|
|
{ "textureProj", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, true },
|
|
{ "textureProj", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, true },
|
|
{ "textureProj", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, true },
|
|
@@ -2002,6 +2008,10 @@ const ShaderLanguage::BuiltinFuncDef ShaderLanguage::builtin_func_defs[] = {
|
|
{ "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true },
|
|
{ "textureProj", TYPE_IVEC4, { TYPE_ISAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true },
|
|
{ "textureProj", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, true },
|
|
{ "textureProj", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, true },
|
|
{ "textureProj", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true },
|
|
{ "textureProj", TYPE_UVEC4, { TYPE_USAMPLER3D, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true },
|
|
|
|
+ { "textureProj", TYPE_VEC4, { TYPE_SAMPLEREXT, TYPE_VEC3, TYPE_VOID }, TAG_GLOBAL, true },
|
|
|
|
+ { "textureProj", TYPE_VEC4, { TYPE_SAMPLEREXT, TYPE_VEC4, TYPE_VOID }, TAG_GLOBAL, true },
|
|
|
|
+ { "textureProj", TYPE_VEC4, { TYPE_SAMPLEREXT, TYPE_VEC3, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true },
|
|
|
|
+ { "textureProj", TYPE_VEC4, { TYPE_SAMPLEREXT, TYPE_VEC4, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true },
|
|
|
|
|
|
{ "textureLod", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false },
|
|
{ "textureLod", TYPE_VEC4, { TYPE_SAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, false },
|
|
{ "textureLod", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true },
|
|
{ "textureLod", TYPE_IVEC4, { TYPE_ISAMPLER2D, TYPE_VEC2, TYPE_FLOAT, TYPE_VOID }, TAG_GLOBAL, true },
|
|
@@ -2452,7 +2462,8 @@ bool ShaderLanguage::is_sampler_type(DataType p_type) {
|
|
p_type == TYPE_SAMPLER3D ||
|
|
p_type == TYPE_SAMPLER3D ||
|
|
p_type == TYPE_ISAMPLER3D ||
|
|
p_type == TYPE_ISAMPLER3D ||
|
|
p_type == TYPE_USAMPLER3D ||
|
|
p_type == TYPE_USAMPLER3D ||
|
|
- p_type == TYPE_SAMPLERCUBE;
|
|
|
|
|
|
+ p_type == TYPE_SAMPLERCUBE ||
|
|
|
|
+ p_type == TYPE_SAMPLEREXT;
|
|
}
|
|
}
|
|
|
|
|
|
Variant ShaderLanguage::constant_value_to_variant(const Vector<ShaderLanguage::ConstantNode::Value> &p_value, DataType p_type, ShaderLanguage::ShaderNode::Uniform::Hint p_hint) {
|
|
Variant ShaderLanguage::constant_value_to_variant(const Vector<ShaderLanguage::ConstantNode::Value> &p_value, DataType p_type, ShaderLanguage::ShaderNode::Uniform::Hint p_hint) {
|
|
@@ -2546,7 +2557,8 @@ Variant ShaderLanguage::constant_value_to_variant(const Vector<ShaderLanguage::C
|
|
case ShaderLanguage::TYPE_USAMPLER2DARRAY:
|
|
case ShaderLanguage::TYPE_USAMPLER2DARRAY:
|
|
case ShaderLanguage::TYPE_USAMPLER2D:
|
|
case ShaderLanguage::TYPE_USAMPLER2D:
|
|
case ShaderLanguage::TYPE_USAMPLER3D:
|
|
case ShaderLanguage::TYPE_USAMPLER3D:
|
|
- case ShaderLanguage::TYPE_SAMPLERCUBE: {
|
|
|
|
|
|
+ case ShaderLanguage::TYPE_SAMPLERCUBE:
|
|
|
|
+ case ShaderLanguage::TYPE_SAMPLEREXT: {
|
|
// Texture types, likely not relevant here.
|
|
// Texture types, likely not relevant here.
|
|
break;
|
|
break;
|
|
}
|
|
}
|