mirror of
https://github.com/godotengine/godot.git
synced 2025-01-22 10:32:54 -05:00
Merge pull request #99622 from Chaosus/shader_fix_global_empty_type
Add `samplerExternalOES` type to shader globals
This commit is contained in:
commit
b773fff5a4
3 changed files with 16 additions and 0 deletions
|
@ -65,6 +65,7 @@ static const char *global_var_type_names[RS::GLOBAL_VAR_TYPE_MAX] = {
|
|||
"sampler2DArray",
|
||||
"sampler3D",
|
||||
"samplerCube",
|
||||
"samplerExternalOES",
|
||||
};
|
||||
|
||||
class ShaderGlobalsEditorInterface : public Object {
|
||||
|
@ -232,6 +233,11 @@ protected:
|
|||
pinfo.hint = PROPERTY_HINT_RESOURCE_TYPE;
|
||||
pinfo.hint_string = "Cubemap,CompressedCubemap";
|
||||
} break;
|
||||
case RS::GLOBAL_VAR_TYPE_SAMPLEREXT: {
|
||||
pinfo.type = Variant::OBJECT;
|
||||
pinfo.hint = PROPERTY_HINT_RESOURCE_TYPE;
|
||||
pinfo.hint_string = "ExternalTexture";
|
||||
} break;
|
||||
default: {
|
||||
} break;
|
||||
}
|
||||
|
@ -339,6 +345,9 @@ static Variant create_var(RS::GlobalShaderParameterType p_type) {
|
|||
case RS::GLOBAL_VAR_TYPE_SAMPLERCUBE: {
|
||||
return "";
|
||||
}
|
||||
case RS::GLOBAL_VAR_TYPE_SAMPLEREXT: {
|
||||
return "";
|
||||
}
|
||||
default: {
|
||||
return Variant();
|
||||
}
|
||||
|
|
|
@ -197,6 +197,11 @@ void ShaderGlobalsOverride::_get_property_list(List<PropertyInfo> *p_list) const
|
|||
pinfo.hint = PROPERTY_HINT_RESOURCE_TYPE;
|
||||
pinfo.hint_string = "Cubemap";
|
||||
} break;
|
||||
case RS::GLOBAL_VAR_TYPE_SAMPLEREXT: {
|
||||
pinfo.type = Variant::OBJECT;
|
||||
pinfo.hint = PROPERTY_HINT_RESOURCE_TYPE;
|
||||
pinfo.hint_string = "ExternalTexture";
|
||||
} break;
|
||||
default: {
|
||||
} break;
|
||||
}
|
||||
|
|
|
@ -1868,6 +1868,8 @@ int RenderingServer::global_shader_uniform_type_get_shader_datatype(GlobalShader
|
|||
return ShaderLanguage::TYPE_SAMPLER3D;
|
||||
case RS::GLOBAL_VAR_TYPE_SAMPLERCUBE:
|
||||
return ShaderLanguage::TYPE_SAMPLERCUBE;
|
||||
case RS::GLOBAL_VAR_TYPE_SAMPLEREXT:
|
||||
return ShaderLanguage::TYPE_SAMPLEREXT;
|
||||
default:
|
||||
return ShaderLanguage::TYPE_MAX; // Invalid or not found.
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue