Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
angle
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
angle
Commits
975af378
Commit
975af378
authored
Jun 12, 2013
by
Geoff Lang
Committed by
Shannon Woods
Jul 19, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Blit11 can now blit depth stencils.
TRAC #23321 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Geoff Lang
parent
d8c86138
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
191 additions
and
2 deletions
+191
-2
libGLESv2.vcxproj
src/libGLESv2/libGLESv2.vcxproj
+1
-0
libGLESv2.vcxproj.filters
src/libGLESv2/libGLESv2.vcxproj.filters
+3
-0
Blit11.cpp
src/libGLESv2/renderer/Blit11.cpp
+0
-0
Blit11.h
src/libGLESv2/renderer/Blit11.h
+15
-0
Renderer11.cpp
src/libGLESv2/renderer/Renderer11.cpp
+17
-2
Passthrough2D11.hlsl
src/libGLESv2/renderer/shaders/Passthrough2D11.hlsl
+5
-0
passthroughdepth2d11ps.h
...GLESv2/renderer/shaders/compiled/passthroughdepth2d11ps.h
+149
-0
generate_shaders.bat
src/libGLESv2/renderer/shaders/generate_shaders.bat
+1
-0
No files found.
src/libGLESv2/libGLESv2.vcxproj
View file @
975af378
...
@@ -390,6 +390,7 @@ copy "$(OutDir)libGLESv2.lib" "$(ProjectDir)..\..\lib\$(Configuration)\"
...
@@ -390,6 +390,7 @@ copy "$(OutDir)libGLESv2.lib" "$(ProjectDir)..\..\lib\$(Configuration)\"
<ClInclude
Include=
"renderer\shaders\compiled\passthrough2d11vs.h"
/>
<ClInclude
Include=
"renderer\shaders\compiled\passthrough2d11vs.h"
/>
<ClInclude
Include=
"renderer\shaders\compiled\passthrough3d11gs.h"
/>
<ClInclude
Include=
"renderer\shaders\compiled\passthrough3d11gs.h"
/>
<ClInclude
Include=
"renderer\shaders\compiled\passthrough3d11vs.h"
/>
<ClInclude
Include=
"renderer\shaders\compiled\passthrough3d11vs.h"
/>
<ClInclude
Include=
"renderer\shaders\compiled\passthroughdepth2d11ps.h"
/>
<ClInclude
Include=
"renderer\shaders\compiled\passthroughlum2d11ps.h"
/>
<ClInclude
Include=
"renderer\shaders\compiled\passthroughlum2d11ps.h"
/>
<ClInclude
Include=
"renderer\shaders\compiled\passthroughlum3d11ps.h"
/>
<ClInclude
Include=
"renderer\shaders\compiled\passthroughlum3d11ps.h"
/>
<ClInclude
Include=
"renderer\shaders\compiled\passthroughlumalpha2d11ps.h"
/>
<ClInclude
Include=
"renderer\shaders\compiled\passthroughlumalpha2d11ps.h"
/>
...
...
src/libGLESv2/libGLESv2.vcxproj.filters
View file @
975af378
...
@@ -613,6 +613,9 @@
...
@@ -613,6 +613,9 @@
<ClInclude
Include=
"renderer\shaders\compiled\passthroughrg2d11ps.h"
>
<ClInclude
Include=
"renderer\shaders\compiled\passthroughrg2d11ps.h"
>
<Filter>
Shaders\Compiled
</Filter>
<Filter>
Shaders\Compiled
</Filter>
</ClInclude>
</ClInclude>
<ClInclude
Include=
"renderer\shaders\compiled\passthroughdepth2d11ps.h"
>
<Filter>
Shaders\Compiled
</Filter>
</ClInclude>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<None
Include=
"renderer\shaders\Blit.ps"
>
<None
Include=
"renderer\shaders\Blit.ps"
>
...
...
src/libGLESv2/renderer/Blit11.cpp
View file @
975af378
This diff is collapsed.
Click to expand it.
src/libGLESv2/renderer/Blit11.h
View file @
975af378
...
@@ -32,6 +32,15 @@ class Blit11
...
@@ -32,6 +32,15 @@ class Blit11
ID3D11RenderTargetView
*
dest
,
const
gl
::
Box
&
destArea
,
const
gl
::
Extents
&
destSize
,
ID3D11RenderTargetView
*
dest
,
const
gl
::
Box
&
destArea
,
const
gl
::
Extents
&
destSize
,
GLenum
destFormat
,
GLenum
filter
);
GLenum
destFormat
,
GLenum
filter
);
bool
copyStencil
(
ID3D11Resource
*
source
,
unsigned
int
sourceSubresource
,
const
gl
::
Box
&
sourceArea
,
const
gl
::
Extents
&
sourceSize
,
ID3D11Resource
*
dest
,
unsigned
int
destSubresource
,
const
gl
::
Box
&
destArea
,
const
gl
::
Extents
&
destSize
);
bool
copyDepth
(
ID3D11ShaderResourceView
*
source
,
const
gl
::
Box
&
sourceArea
,
const
gl
::
Extents
&
sourceSize
,
ID3D11DepthStencilView
*
dest
,
const
gl
::
Box
&
destArea
,
const
gl
::
Extents
&
destSize
);
bool
copyDepthStencil
(
ID3D11Resource
*
source
,
unsigned
int
sourceSubresource
,
const
gl
::
Box
&
sourceArea
,
const
gl
::
Extents
&
sourceSize
,
ID3D11Resource
*
dest
,
unsigned
int
destSubresource
,
const
gl
::
Box
&
destArea
,
const
gl
::
Extents
&
destSize
);
private
:
private
:
rx
::
Renderer11
*
mRenderer
;
rx
::
Renderer11
*
mRenderer
;
...
@@ -42,6 +51,10 @@ class Blit11
...
@@ -42,6 +51,10 @@ class Blit11
bool
m3DBlit
;
bool
m3DBlit
;
};
};
bool
copyDepthStencil
(
ID3D11Resource
*
source
,
unsigned
int
sourceSubresource
,
const
gl
::
Box
&
sourceArea
,
const
gl
::
Extents
&
sourceSize
,
ID3D11Resource
*
dest
,
unsigned
int
destSubresource
,
const
gl
::
Box
&
destArea
,
const
gl
::
Extents
&
destSize
,
bool
stencilOnly
);
static
bool
compareBlitParameters
(
const
BlitParameters
&
a
,
const
BlitParameters
&
b
);
static
bool
compareBlitParameters
(
const
BlitParameters
&
a
,
const
BlitParameters
&
b
);
typedef
void
(
*
WriteVertexFunction
)(
const
gl
::
Box
&
sourceArea
,
const
gl
::
Extents
&
sourceSize
,
typedef
void
(
*
WriteVertexFunction
)(
const
gl
::
Box
&
sourceArea
,
const
gl
::
Extents
&
sourceSize
,
...
@@ -72,9 +85,11 @@ class Blit11
...
@@ -72,9 +85,11 @@ class Blit11
ID3D11SamplerState
*
mPointSampler
;
ID3D11SamplerState
*
mPointSampler
;
ID3D11SamplerState
*
mLinearSampler
;
ID3D11SamplerState
*
mLinearSampler
;
ID3D11RasterizerState
*
mRasterizerState
;
ID3D11RasterizerState
*
mRasterizerState
;
ID3D11DepthStencilState
*
mDepthStencilState
;
ID3D11InputLayout
*
mQuad2DIL
;
ID3D11InputLayout
*
mQuad2DIL
;
ID3D11VertexShader
*
mQuad2DVS
;
ID3D11VertexShader
*
mQuad2DVS
;
ID3D11PixelShader
*
mDepthPS
;
ID3D11InputLayout
*
mQuad3DIL
;
ID3D11InputLayout
*
mQuad3DIL
;
ID3D11VertexShader
*
mQuad3DVS
;
ID3D11VertexShader
*
mQuad3DVS
;
...
...
src/libGLESv2/renderer/Renderer11.cpp
View file @
975af378
...
@@ -3295,6 +3295,11 @@ void Renderer11::readTextureData(ID3D11Texture2D *texture, unsigned int subResou
...
@@ -3295,6 +3295,11 @@ void Renderer11::readTextureData(ID3D11Texture2D *texture, unsigned int subResou
bool
Renderer11
::
blitRenderbufferRect
(
const
gl
::
Rectangle
&
readRect
,
const
gl
::
Rectangle
&
drawRect
,
RenderTarget
*
readRenderTarget
,
bool
Renderer11
::
blitRenderbufferRect
(
const
gl
::
Rectangle
&
readRect
,
const
gl
::
Rectangle
&
drawRect
,
RenderTarget
*
readRenderTarget
,
RenderTarget
*
drawRenderTarget
,
GLenum
filter
,
bool
colorBlit
,
bool
depthBlit
,
bool
stencilBlit
)
RenderTarget
*
drawRenderTarget
,
GLenum
filter
,
bool
colorBlit
,
bool
depthBlit
,
bool
stencilBlit
)
{
{
// Since blitRenderbufferRect is called for each render buffer that needs to be blitted,
// it should never be the case that both color and depth/stencil need to be blitted at
// at the same time.
ASSERT
(
colorBlit
!=
(
depthBlit
||
stencilBlit
));
bool
result
=
true
;
bool
result
=
true
;
RenderTarget11
*
readRenderTarget11
=
RenderTarget11
::
makeRenderTarget11
(
readRenderTarget
);
RenderTarget11
*
readRenderTarget11
=
RenderTarget11
::
makeRenderTarget11
(
readRenderTarget
);
...
@@ -3388,9 +3393,19 @@ bool Renderer11::blitRenderbufferRect(const gl::Rectangle &readRect, const gl::R
...
@@ -3388,9 +3393,19 @@ bool Renderer11::blitRenderbufferRect(const gl::Rectangle &readRect, const gl::R
gl
::
Box
drawArea
(
drawRect
.
x
,
drawRect
.
y
,
0
,
drawRect
.
width
,
drawRect
.
height
,
1
);
gl
::
Box
drawArea
(
drawRect
.
x
,
drawRect
.
y
,
0
,
drawRect
.
width
,
drawRect
.
height
,
1
);
gl
::
Extents
drawSize
(
drawRenderTarget
->
getWidth
(),
drawRenderTarget
->
getHeight
(),
1
);
gl
::
Extents
drawSize
(
drawRenderTarget
->
getWidth
(),
drawRenderTarget
->
getHeight
(),
1
);
if
(
depthBlit
||
stencilBlit
)
if
(
depthBlit
&&
stencilBlit
)
{
result
=
mBlit
->
copyDepthStencil
(
readTexture
,
readSubresource
,
readArea
,
readSize
,
drawTexture
,
drawSubresource
,
drawArea
,
drawSize
);
}
else
if
(
depthBlit
)
{
result
=
mBlit
->
copyDepth
(
readSRV
,
readArea
,
readSize
,
drawDSV
,
drawArea
,
drawSize
);
}
else
if
(
stencilBlit
)
{
{
UNIMPLEMENTED
();
result
=
mBlit
->
copyStencil
(
readTexture
,
readSubresource
,
readArea
,
readSize
,
drawTexture
,
drawSubresource
,
drawArea
,
drawSize
);
}
}
else
else
{
{
...
...
src/libGLESv2/renderer/shaders/Passthrough2D11.hlsl
View file @
975af378
...
@@ -11,6 +11,11 @@ void VS_Passthrough2D( in float2 inPosition : POSITION, in float2 inTexCoo
...
@@ -11,6 +11,11 @@ void VS_Passthrough2D( in float2 inPosition : POSITION, in float2 inTexCoo
outTexCoord = inTexCoord;
outTexCoord = inTexCoord;
}
}
float PS_PassthroughDepth2D(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_DEPTH
{
return TextureF.Sample(Sampler, inTexCoord).r;
}
float4 PS_PassthroughRGBA2D(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0
float4 PS_PassthroughRGBA2D(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0
{
{
return TextureF.Sample(Sampler, inTexCoord).rgba;
return TextureF.Sample(Sampler, inTexCoord).rgba;
...
...
src/libGLESv2/renderer/shaders/compiled/passthroughdepth2d11ps.h
0 → 100644
View file @
975af378
#if 0
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//
// fxc /E PS_PassthroughDepth2D /T ps_4_0 /Fh
// compiled/passthroughdepth2d11ps.h Passthrough2D11.hlsl
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// Sampler sampler NA NA 0 1
// TextureF texture float4 2d 0 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------ ------
// SV_POSITION 0 xyzw 0 POS float
// TEXCOORD 0 xy 1 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------ ------
// SV_DEPTH 0 N/A oDepth DEPTH float YES
//
ps_4_0
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v1.xy
dcl_output oDepth
dcl_temps 1
sample r0.xyzw, v1.xyxx, t0.xyzw, s0
mov oDepth, r0.x
ret
// Approximately 3 instruction slots used
#endif
const
BYTE
g_PS_PassthroughDepth2D
[]
=
{
68
,
88
,
66
,
67
,
18
,
100
,
210
,
152
,
138
,
132
,
5
,
51
,
93
,
169
,
189
,
245
,
32
,
164
,
14
,
233
,
1
,
0
,
0
,
0
,
100
,
2
,
0
,
0
,
5
,
0
,
0
,
0
,
52
,
0
,
0
,
0
,
220
,
0
,
0
,
0
,
52
,
1
,
0
,
0
,
104
,
1
,
0
,
0
,
232
,
1
,
0
,
0
,
82
,
68
,
69
,
70
,
160
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
2
,
0
,
0
,
0
,
28
,
0
,
0
,
0
,
0
,
4
,
255
,
255
,
0
,
1
,
0
,
0
,
109
,
0
,
0
,
0
,
92
,
0
,
0
,
0
,
3
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
100
,
0
,
0
,
0
,
2
,
0
,
0
,
0
,
5
,
0
,
0
,
0
,
4
,
0
,
0
,
0
,
255
,
255
,
255
,
255
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
13
,
0
,
0
,
0
,
83
,
97
,
109
,
112
,
108
,
101
,
114
,
0
,
84
,
101
,
120
,
116
,
117
,
114
,
101
,
70
,
0
,
77
,
105
,
99
,
114
,
111
,
115
,
111
,
102
,
116
,
32
,
40
,
82
,
41
,
32
,
72
,
76
,
83
,
76
,
32
,
83
,
104
,
97
,
100
,
101
,
114
,
32
,
67
,
111
,
109
,
112
,
105
,
108
,
101
,
114
,
32
,
57
,
46
,
50
,
57
,
46
,
57
,
53
,
50
,
46
,
51
,
49
,
49
,
49
,
0
,
171
,
171
,
73
,
83
,
71
,
78
,
80
,
0
,
0
,
0
,
2
,
0
,
0
,
0
,
8
,
0
,
0
,
0
,
56
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
3
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
15
,
0
,
0
,
0
,
68
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
3
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
3
,
3
,
0
,
0
,
83
,
86
,
95
,
80
,
79
,
83
,
73
,
84
,
73
,
79
,
78
,
0
,
84
,
69
,
88
,
67
,
79
,
79
,
82
,
68
,
0
,
171
,
171
,
171
,
79
,
83
,
71
,
78
,
44
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
8
,
0
,
0
,
0
,
32
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
3
,
0
,
0
,
0
,
255
,
255
,
255
,
255
,
1
,
14
,
0
,
0
,
83
,
86
,
95
,
68
,
69
,
80
,
84
,
72
,
0
,
171
,
171
,
171
,
83
,
72
,
68
,
82
,
120
,
0
,
0
,
0
,
64
,
0
,
0
,
0
,
30
,
0
,
0
,
0
,
90
,
0
,
0
,
3
,
0
,
96
,
16
,
0
,
0
,
0
,
0
,
0
,
88
,
24
,
0
,
4
,
0
,
112
,
16
,
0
,
0
,
0
,
0
,
0
,
85
,
85
,
0
,
0
,
98
,
16
,
0
,
3
,
50
,
16
,
16
,
0
,
1
,
0
,
0
,
0
,
101
,
0
,
0
,
2
,
1
,
192
,
0
,
0
,
104
,
0
,
0
,
2
,
1
,
0
,
0
,
0
,
69
,
0
,
0
,
9
,
242
,
0
,
16
,
0
,
0
,
0
,
0
,
0
,
70
,
16
,
16
,
0
,
1
,
0
,
0
,
0
,
70
,
126
,
16
,
0
,
0
,
0
,
0
,
0
,
0
,
96
,
16
,
0
,
0
,
0
,
0
,
0
,
54
,
0
,
0
,
4
,
1
,
192
,
0
,
0
,
10
,
0
,
16
,
0
,
0
,
0
,
0
,
0
,
62
,
0
,
0
,
1
,
83
,
84
,
65
,
84
,
116
,
0
,
0
,
0
,
3
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
2
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
src/libGLESv2/renderer/shaders/generate_shaders.bat
View file @
975af378
...
@@ -14,6 +14,7 @@ fxc /E luminanceps /T ps_2_0 /Fh compiled/luminanceps.h Blit.ps
...
@@ -14,6 +14,7 @@ fxc /E luminanceps /T ps_2_0 /Fh compiled/luminanceps.h Blit.ps
fxc /E componentmaskps /T ps_2_0 /Fh compiled/componentmaskps.h Blit.ps
fxc /E componentmaskps /T ps_2_0 /Fh compiled/componentmaskps.h Blit.ps
fxc /E VS_Passthrough2D /T vs_4_0 /Fh compiled/passthrough2d11vs.h Passthrough2D11.hlsl
fxc /E VS_Passthrough2D /T vs_4_0 /Fh compiled/passthrough2d11vs.h Passthrough2D11.hlsl
fxc /E PS_PassthroughDepth2D /T ps_4_0 /Fh compiled/passthroughdepth2d11ps.h Passthrough2D11.hlsl
fxc /E PS_PassthroughRGBA2D /T ps_4_0 /Fh compiled/passthroughrgba2d11ps.h Passthrough2D11.hlsl
fxc /E PS_PassthroughRGBA2D /T ps_4_0 /Fh compiled/passthroughrgba2d11ps.h Passthrough2D11.hlsl
fxc /E PS_PassthroughRGBA2DUI /T ps_4_0 /Fh compiled/passthroughrgba2dui11ps.h Passthrough2D11.hlsl
fxc /E PS_PassthroughRGBA2DUI /T ps_4_0 /Fh compiled/passthroughrgba2dui11ps.h Passthrough2D11.hlsl
fxc /E PS_PassthroughRGBA2DI /T ps_4_0 /Fh compiled/passthroughrgba2di11ps.h Passthrough2D11.hlsl
fxc /E PS_PassthroughRGBA2DI /T ps_4_0 /Fh compiled/passthroughrgba2di11ps.h Passthrough2D11.hlsl
...
...
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