Shader: Set proper resource type hints for sampler uniforms
Supersedes #64383.
This commit is contained in:
parent
e3a51e53ef
commit
cb1826deae
1 changed files with 15 additions and 17 deletions
|
@ -4110,43 +4110,41 @@ PropertyInfo ShaderLanguage::uniform_to_property_info(const ShaderNode::Uniform
|
|||
case ShaderLanguage::TYPE_USAMPLER2D: {
|
||||
if (p_uniform.array_size > 0) {
|
||||
pi.type = Variant::ARRAY;
|
||||
pi.hint = PROPERTY_HINT_ARRAY_TYPE;
|
||||
pi.hint_string = vformat("%s/%s:%s", Variant::OBJECT, PROPERTY_HINT_RESOURCE_TYPE, "Texture2D");
|
||||
} else {
|
||||
pi.type = Variant::OBJECT;
|
||||
pi.hint = PROPERTY_HINT_RESOURCE_TYPE;
|
||||
pi.hint_string = "Texture2D";
|
||||
}
|
||||
pi.hint = PROPERTY_HINT_RESOURCE_TYPE;
|
||||
pi.hint_string = "Texture2D";
|
||||
} break;
|
||||
case ShaderLanguage::TYPE_SAMPLER2DARRAY:
|
||||
case ShaderLanguage::TYPE_ISAMPLER2DARRAY:
|
||||
case ShaderLanguage::TYPE_USAMPLER2DARRAY: {
|
||||
case ShaderLanguage::TYPE_USAMPLER2DARRAY:
|
||||
case ShaderLanguage::TYPE_SAMPLERCUBE:
|
||||
case ShaderLanguage::TYPE_SAMPLERCUBEARRAY: {
|
||||
if (p_uniform.array_size > 0) {
|
||||
pi.type = Variant::ARRAY;
|
||||
pi.hint = PROPERTY_HINT_ARRAY_TYPE;
|
||||
pi.hint_string = vformat("%s/%s:%s", Variant::OBJECT, PROPERTY_HINT_RESOURCE_TYPE, "TextureLayered");
|
||||
} else {
|
||||
pi.type = Variant::OBJECT;
|
||||
pi.hint = PROPERTY_HINT_RESOURCE_TYPE;
|
||||
pi.hint_string = "TextureLayered";
|
||||
}
|
||||
pi.hint = PROPERTY_HINT_RESOURCE_TYPE;
|
||||
pi.hint_string = "TextureLayered";
|
||||
} break;
|
||||
case ShaderLanguage::TYPE_SAMPLER3D:
|
||||
case ShaderLanguage::TYPE_ISAMPLER3D:
|
||||
case ShaderLanguage::TYPE_USAMPLER3D: {
|
||||
if (p_uniform.array_size > 0) {
|
||||
pi.type = Variant::ARRAY;
|
||||
pi.hint = PROPERTY_HINT_ARRAY_TYPE;
|
||||
pi.hint_string = vformat("%s/%s:%s", Variant::OBJECT, PROPERTY_HINT_RESOURCE_TYPE, "Texture3D");
|
||||
} else {
|
||||
pi.type = Variant::OBJECT;
|
||||
pi.hint = PROPERTY_HINT_RESOURCE_TYPE;
|
||||
pi.hint_string = "Texture3D";
|
||||
}
|
||||
pi.hint = PROPERTY_HINT_RESOURCE_TYPE;
|
||||
pi.hint_string = "Texture3D";
|
||||
} break;
|
||||
case ShaderLanguage::TYPE_SAMPLERCUBE:
|
||||
case ShaderLanguage::TYPE_SAMPLERCUBEARRAY: {
|
||||
if (p_uniform.array_size > 0) {
|
||||
pi.type = Variant::ARRAY;
|
||||
} else {
|
||||
pi.type = Variant::OBJECT;
|
||||
}
|
||||
pi.hint = PROPERTY_HINT_RESOURCE_TYPE;
|
||||
pi.hint_string = "TextureLayered";
|
||||
} break;
|
||||
case ShaderLanguage::TYPE_STRUCT: {
|
||||
// FIXME: Implement this.
|
||||
|
|
Loading…
Reference in a new issue