Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
swiftshader
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
Chen Yisong
swiftshader
Commits
059bece5
Commit
059bece5
authored
May 06, 2014
by
Nicolas Capens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed reading back gl_PointSize.
parent
4677a5f7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
6 deletions
+17
-6
Version.h
src/Common/Version.h
+1
-1
OutputASM.cpp
src/GLES2/compiler/OutputASM.cpp
+15
-5
OutputASM.h
src/GLES2/compiler/OutputASM.h
+1
-0
No files found.
src/Common/Version.h
View file @
059bece5
#define MAJOR_VERSION 3
#define MAJOR_VERSION 3
#define MINOR_VERSION 1
#define MINOR_VERSION 1
#define BUILD_VERSION 0
#define BUILD_VERSION 0
#define BUILD_REVISION 517
1
#define BUILD_REVISION 517
2
#define STRINGIFY(x) #x
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
#define MACRO_STRINGIFY(x) STRINGIFY(x)
...
...
src/GLES2/compiler/OutputASM.cpp
View file @
059bece5
...
@@ -21,8 +21,6 @@
...
@@ -21,8 +21,6 @@
namespace
sh
namespace
sh
{
{
static
const
unsigned
char
swizzleSize
[
5
]
=
{
0x00
,
0x00
,
0x54
,
0xA4
,
0xE4
};
// (void), xxxx, xyyy, xyzz, xyzw
// Integer to TString conversion
// Integer to TString conversion
TString
str
(
int
i
)
TString
str
(
int
i
)
{
{
...
@@ -875,7 +873,7 @@ namespace sh
...
@@ -875,7 +873,7 @@ namespace sh
Instruction
*
mov
=
emit
(
sw
::
Shader
::
OPCODE_MOV
,
result
,
argi
);
Instruction
*
mov
=
emit
(
sw
::
Shader
::
OPCODE_MOV
,
result
,
argi
);
mov
->
dst
.
mask
=
(
0xF
<<
component
)
&
0xF
;
mov
->
dst
.
mask
=
(
0xF
<<
component
)
&
0xF
;
mov
->
src
[
0
].
swizzle
=
swizzleSize
[
size
]
<<
(
component
*
2
);
mov
->
src
[
0
].
swizzle
=
readSwizzle
(
argi
,
size
)
<<
(
component
*
2
);
component
+=
size
;
component
+=
size
;
}
}
...
@@ -926,7 +924,7 @@ namespace sh
...
@@ -926,7 +924,7 @@ namespace sh
Instruction
*
mov
=
emit
(
sw
::
Shader
::
OPCODE_MOV
,
result
,
argi
);
Instruction
*
mov
=
emit
(
sw
::
Shader
::
OPCODE_MOV
,
result
,
argi
);
mov
->
dst
.
index
+=
column
;
mov
->
dst
.
index
+=
column
;
mov
->
dst
.
mask
=
(
0xF
<<
row
)
&
0xF
;
mov
->
dst
.
mask
=
(
0xF
<<
row
)
&
0xF
;
mov
->
src
[
0
].
swizzle
=
(
swizzleSize
[
size
]
<<
(
row
*
2
))
+
0x55
*
element
;
mov
->
src
[
0
].
swizzle
=
(
readSwizzle
(
argi
,
size
)
<<
(
row
*
2
))
+
0x55
*
element
;
int
end
=
row
+
size
-
element
;
int
end
=
row
+
size
-
element
;
column
=
end
>=
dim
?
column
+
1
:
column
;
column
=
end
>=
dim
?
column
+
1
:
column
;
...
@@ -1444,7 +1442,7 @@ namespace sh
...
@@ -1444,7 +1442,7 @@ namespace sh
if
(
!
IsSampler
(
arg
->
getBasicType
()))
if
(
!
IsSampler
(
arg
->
getBasicType
()))
{
{
parameter
.
swizzle
=
swizzleSize
[
size
]
;
parameter
.
swizzle
=
readSwizzle
(
arg
,
size
)
;
}
}
}
}
}
}
...
@@ -1762,6 +1760,18 @@ namespace sh
...
@@ -1762,6 +1760,18 @@ namespace sh
return
0xF
>>
(
4
-
registerSize
(
destination
->
getType
(),
index
));
return
0xF
>>
(
4
-
registerSize
(
destination
->
getType
(),
index
));
}
}
int
OutputASM
::
readSwizzle
(
TIntermTyped
*
argument
,
int
size
)
{
if
(
argument
->
getQualifier
()
==
EvqPointSize
)
{
return
0x55
;
// Point size stored in the y component
}
static
const
unsigned
char
swizzleSize
[
5
]
=
{
0x00
,
0x00
,
0x54
,
0xA4
,
0xE4
};
// (void), xxxx, xyyy, xyzz, xyzw
return
swizzleSize
[
size
];
}
// Conservatively checks whether an expression is fast to compute and has no side effects
// Conservatively checks whether an expression is fast to compute and has no side effects
bool
OutputASM
::
trivial
(
TIntermTyped
*
expression
,
int
budget
)
bool
OutputASM
::
trivial
(
TIntermTyped
*
expression
,
int
budget
)
{
{
...
...
src/GLES2/compiler/OutputASM.h
View file @
059bece5
...
@@ -117,6 +117,7 @@ namespace sh
...
@@ -117,6 +117,7 @@ namespace sh
sw
::
Shader
::
ParameterType
registerType
(
TIntermTyped
*
operand
);
sw
::
Shader
::
ParameterType
registerType
(
TIntermTyped
*
operand
);
int
registerIndex
(
TIntermTyped
*
operand
);
int
registerIndex
(
TIntermTyped
*
operand
);
int
writeMask
(
TIntermTyped
*
destination
,
int
index
=
0
);
int
writeMask
(
TIntermTyped
*
destination
,
int
index
=
0
);
int
readSwizzle
(
TIntermTyped
*
argument
,
int
size
);
bool
trivial
(
TIntermTyped
*
expression
,
int
budget
);
// Fast to compute and no side effects
bool
trivial
(
TIntermTyped
*
expression
,
int
budget
);
// Fast to compute and no side effects
int
cost
(
TIntermNode
*
expression
,
int
budget
);
int
cost
(
TIntermNode
*
expression
,
int
budget
);
const
Function
&
findFunction
(
const
TString
&
name
);
const
Function
&
findFunction
(
const
TString
&
name
);
...
...
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