Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
6756896b
Unverified
Commit
6756896b
authored
Feb 20, 2018
by
Juan Linietsky
Committed by
GitHub
Feb 20, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16852 from godotengine/revert-15985-uniforms-single-argument-constructors
Revert "Handle single-argument constructors in uniform default values"
parents
05a8675f
4c56edfb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
54 deletions
+0
-54
shader_language.cpp
servers/visual/shader_language.cpp
+0
-54
No files found.
servers/visual/shader_language.cpp
View file @
6756896b
...
...
@@ -3138,60 +3138,6 @@ ShaderLanguage::Node *ShaderLanguage::_reduce_expression(BlockNode *p_block, Sha
}
}
// Passed a single argument
if
(
op
->
arguments
.
size
()
<=
2
)
{
if
(
op
->
get_datatype
()
<
TYPE_MAT2
)
{
// Scalar or vector
int
dimensions
=
0
;
switch
(
op
->
get_datatype
())
{
case
TYPE_VEC2
:
case
TYPE_BVEC2
:
case
TYPE_UVEC2
:
case
TYPE_IVEC2
:
{
dimensions
=
2
;
}
break
;
case
TYPE_VEC3
:
case
TYPE_BVEC3
:
case
TYPE_UVEC3
:
case
TYPE_IVEC3
:
{
dimensions
=
3
;
}
break
;
case
TYPE_VEC4
:
case
TYPE_BVEC4
:
case
TYPE_UVEC4
:
case
TYPE_IVEC4
:
{
dimensions
=
4
;
}
break
;
}
if
(
dimensions
)
{
ConstantNode
::
Value
val
=
values
[
0
];
for
(
int
i
=
1
;
i
<
dimensions
;
i
++
)
{
values
.
push_back
(
val
);
}
}
}
else
if
(
op
->
get_datatype
()
<=
TYPE_MAT4
)
{
// Matrix
int
dimensions
=
0
;
switch
(
op
->
get_datatype
())
{
case
TYPE_MAT2
:
dimensions
=
2
;
break
;
case
TYPE_MAT3
:
dimensions
=
3
;
break
;
case
TYPE_MAT4
:
dimensions
=
4
;
break
;
}
// Fill the diagonal with the value, the rest with zeroes
ConstantNode
::
Value
val
=
values
[
0
];
for
(
int
i
=
1
;
i
<
dimensions
*
dimensions
;
i
++
)
{
if
(
i
%
(
dimensions
+
1
)
==
0
)
{
values
.
push_back
(
val
);
}
else
{
values
.
push_back
(
ConstantNode
::
Value
());
}
}
}
}
ConstantNode
*
cn
=
alloc_node
<
ConstantNode
>
();
cn
->
datatype
=
op
->
get_datatype
();
cn
->
values
=
values
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment