summaryrefslogtreecommitdiffstats
path: root/servers/rendering
diff options
context:
space:
mode:
authorGeorge L. Albany <Megacake1234@gmail.com>2024-11-12 20:29:24 +0000
committerGitHub <noreply@github.com>2024-11-12 20:29:24 +0000
commitac1a49725fc038ae11ef9060fecb2b0f9c6333b2 (patch)
treec7341bd56c977259578b127886c9a88eeef11820 /servers/rendering
parent5094c2a5f7d506b0e685120f14d1df42e1e9d495 (diff)
parent3a73c6ebd18bff0fa125be58d3ac9c7a63bab61d (diff)
downloadredot-engine-ac1a49725fc038ae11ef9060fecb2b0f9c6333b2.tar.gz
Merge pull request #855 from Spartan322/merge/cb411fa
Merge commit godotengine/godot@cb411fa
Diffstat (limited to 'servers/rendering')
-rw-r--r--servers/rendering/renderer_rd/storage_rd/texture_storage.cpp4
-rw-r--r--servers/rendering/shader_compiler.cpp10
2 files changed, 11 insertions, 3 deletions
diff --git a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp
index 6a18545045..3db3173518 100644
--- a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp
+++ b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp
@@ -1668,7 +1668,9 @@ void TextureStorage::texture_rd_initialize(RID p_texture, const RID &p_rd_textur
ERR_FAIL_COND(tf.array_layers != 1);
texture.type = TextureStorage::TYPE_2D;
} break;
- case RD::TEXTURE_TYPE_2D_ARRAY: {
+ case RD::TEXTURE_TYPE_2D_ARRAY:
+ case RD::TEXTURE_TYPE_CUBE:
+ case RD::TEXTURE_TYPE_CUBE_ARRAY: {
// RenderingDevice doesn't distinguish between Array textures and Cube textures
// this condition covers TextureArrays, TextureCube, and TextureCubeArray.
ERR_FAIL_COND(tf.array_layers == 1);
diff --git a/servers/rendering/shader_compiler.cpp b/servers/rendering/shader_compiler.cpp
index 823872d626..a453d532a8 100644
--- a/servers/rendering/shader_compiler.cpp
+++ b/servers/rendering/shader_compiler.cpp
@@ -491,7 +491,7 @@ String ShaderCompiler::_dump_node_code(const SL::Node *p_node, int p_level, Gene
struct_code += _typestr(m->datatype);
}
struct_code += " ";
- struct_code += m->name;
+ struct_code += _mkid(m->name);
if (m->array_size > 0) {
struct_code += "[";
struct_code += itos(m->array_size);
@@ -1450,7 +1450,13 @@ String ShaderCompiler::_dump_node_code(const SL::Node *p_node, int p_level, Gene
} break;
case SL::Node::NODE_TYPE_MEMBER: {
SL::MemberNode *mnode = (SL::MemberNode *)p_node;
- code = _dump_node_code(mnode->owner, p_level, r_gen_code, p_actions, p_default_actions, p_assigning) + "." + mnode->name;
+ String name;
+ if (mnode->basetype == SL::TYPE_STRUCT) {
+ name = _mkid(mnode->name);
+ } else {
+ name = mnode->name;
+ }
+ code = _dump_node_code(mnode->owner, p_level, r_gen_code, p_actions, p_default_actions, p_assigning) + "." + name;
if (mnode->index_expression != nullptr) {
code += "[";
code += _dump_node_code(mnode->index_expression, p_level, r_gen_code, p_actions, p_default_actions, p_assigning);