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
c6354ee5
Commit
c6354ee5
authored
Jul 22, 2013
by
Geoff Lang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cache applied constant buffers.
Issue #451 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Geoff Lang
parent
1f53cab0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
4 deletions
+42
-4
Renderer11.cpp
src/libGLESv2/renderer/Renderer11.cpp
+36
-4
Renderer11.h
src/libGLESv2/renderer/Renderer11.h
+6
-0
No files found.
src/libGLESv2/renderer/Renderer11.cpp
View file @
c6354ee5
...
@@ -633,7 +633,12 @@ bool Renderer11::setUniformBuffers(const gl::Buffer *vertexUniformBuffers[], con
...
@@ -633,7 +633,12 @@ bool Renderer11::setUniformBuffers(const gl::Buffer *vertexUniformBuffers[], con
return
false
;
return
false
;
}
}
vertexConstantBuffers
[
uniformBufferIndex
]
=
constantBuffer
;
if
(
mCurrentConstantBufferVS
[
uniformBufferIndex
]
!=
bufferStorage
->
getSerial
())
{
mDeviceContext
->
VSSetConstantBuffers
(
getReservedVertexUniformBuffers
()
+
uniformBufferIndex
,
1
,
&
constantBuffer
);
mCurrentConstantBufferVS
[
uniformBufferIndex
]
=
bufferStorage
->
getSerial
();
}
}
}
}
}
...
@@ -650,13 +655,17 @@ bool Renderer11::setUniformBuffers(const gl::Buffer *vertexUniformBuffers[], con
...
@@ -650,13 +655,17 @@ bool Renderer11::setUniformBuffers(const gl::Buffer *vertexUniformBuffers[], con
return
false
;
return
false
;
}
}
if
(
mCurrentConstantBufferPS
[
uniformBufferIndex
]
!=
bufferStorage
->
getSerial
())
{
mDeviceContext
->
PSSetConstantBuffers
(
getReservedFragmentUniformBuffers
()
+
uniformBufferIndex
,
1
,
&
constantBuffer
);
mCurrentConstantBufferPS
[
uniformBufferIndex
]
=
bufferStorage
->
getSerial
();
}
pixelConstantBuffers
[
uniformBufferIndex
]
=
constantBuffer
;
pixelConstantBuffers
[
uniformBufferIndex
]
=
constantBuffer
;
}
}
}
}
mDeviceContext
->
VSSetConstantBuffers
(
getReservedVertexUniformBuffers
(),
getMaxVertexShaderUniformBuffers
(),
vertexConstantBuffers
);
mDeviceContext
->
PSSetConstantBuffers
(
getReservedFragmentUniformBuffers
(),
getMaxFragmentShaderUniformBuffers
(),
pixelConstantBuffers
);
return
true
;
return
true
;
}
}
...
@@ -1463,8 +1472,17 @@ void Renderer11::applyUniforms(gl::ProgramBinary *programBinary, gl::UniformArra
...
@@ -1463,8 +1472,17 @@ void Renderer11::applyUniforms(gl::ProgramBinary *programBinary, gl::UniformArra
mDeviceContext
->
Unmap
(
pixelConstantBuffer
,
0
);
mDeviceContext
->
Unmap
(
pixelConstantBuffer
,
0
);
}
}
if
(
mCurrentVertexConstantBuffer
!=
vertexConstantBuffer
)
{
mDeviceContext
->
VSSetConstantBuffers
(
0
,
1
,
&
vertexConstantBuffer
);
mDeviceContext
->
VSSetConstantBuffers
(
0
,
1
,
&
vertexConstantBuffer
);
mCurrentVertexConstantBuffer
=
vertexConstantBuffer
;
}
if
(
mCurrentPixelConstantBuffer
!=
pixelConstantBuffer
)
{
mDeviceContext
->
PSSetConstantBuffers
(
0
,
1
,
&
pixelConstantBuffer
);
mDeviceContext
->
PSSetConstantBuffers
(
0
,
1
,
&
pixelConstantBuffer
);
mCurrentPixelConstantBuffer
=
pixelConstantBuffer
;
}
// Driver uniforms
// Driver uniforms
if
(
!
mDriverConstantBufferVS
)
if
(
!
mDriverConstantBufferVS
)
...
@@ -1512,7 +1530,11 @@ void Renderer11::applyUniforms(gl::ProgramBinary *programBinary, gl::UniformArra
...
@@ -1512,7 +1530,11 @@ void Renderer11::applyUniforms(gl::ProgramBinary *programBinary, gl::UniformArra
}
}
// needed for the point sprite geometry shader
// needed for the point sprite geometry shader
if
(
mCurrentGeometryConstantBuffer
!=
mDriverConstantBufferPS
)
{
mDeviceContext
->
GSSetConstantBuffers
(
0
,
1
,
&
mDriverConstantBufferPS
);
mDeviceContext
->
GSSetConstantBuffers
(
0
,
1
,
&
mDriverConstantBufferPS
);
mCurrentGeometryConstantBuffer
=
mDriverConstantBufferPS
;
}
}
}
void
Renderer11
::
clear
(
const
gl
::
ClearParameters
&
clearParams
,
gl
::
Framebuffer
*
frameBuffer
)
void
Renderer11
::
clear
(
const
gl
::
ClearParameters
&
clearParams
,
gl
::
Framebuffer
*
frameBuffer
)
...
@@ -1821,6 +1843,16 @@ void Renderer11::markAllStateDirty()
...
@@ -1821,6 +1843,16 @@ void Renderer11::markAllStateDirty()
memset
(
&
mAppliedPixelConstants
,
0
,
sizeof
(
dx_PixelConstants
));
memset
(
&
mAppliedPixelConstants
,
0
,
sizeof
(
dx_PixelConstants
));
mInputLayoutCache
.
markDirty
();
mInputLayoutCache
.
markDirty
();
for
(
unsigned
int
i
=
0
;
i
<
gl
::
IMPLEMENTATION_MAX_VERTEX_SHADER_UNIFORM_BUFFERS
;
i
++
)
{
mCurrentConstantBufferVS
[
i
]
=
-
1
;
mCurrentConstantBufferPS
[
i
]
=
-
1
;
}
mCurrentVertexConstantBuffer
=
NULL
;
mCurrentPixelConstantBuffer
=
NULL
;
mCurrentGeometryConstantBuffer
=
NULL
;
}
}
void
Renderer11
::
releaseDeviceResources
()
void
Renderer11
::
releaseDeviceResources
()
...
...
src/libGLESv2/renderer/Renderer11.h
View file @
c6354ee5
...
@@ -327,10 +327,16 @@ class Renderer11 : public Renderer
...
@@ -327,10 +327,16 @@ class Renderer11 : public Renderer
dx_VertexConstants
mVertexConstants
;
dx_VertexConstants
mVertexConstants
;
dx_VertexConstants
mAppliedVertexConstants
;
dx_VertexConstants
mAppliedVertexConstants
;
ID3D11Buffer
*
mDriverConstantBufferVS
;
ID3D11Buffer
*
mDriverConstantBufferVS
;
ID3D11Buffer
*
mCurrentVertexConstantBuffer
;
unsigned
int
mCurrentConstantBufferVS
[
gl
::
IMPLEMENTATION_MAX_VERTEX_SHADER_UNIFORM_BUFFERS
];
dx_PixelConstants
mPixelConstants
;
dx_PixelConstants
mPixelConstants
;
dx_PixelConstants
mAppliedPixelConstants
;
dx_PixelConstants
mAppliedPixelConstants
;
ID3D11Buffer
*
mDriverConstantBufferPS
;
ID3D11Buffer
*
mDriverConstantBufferPS
;
ID3D11Buffer
*
mCurrentPixelConstantBuffer
;
unsigned
int
mCurrentConstantBufferPS
[
gl
::
IMPLEMENTATION_MAX_VERTEX_SHADER_UNIFORM_BUFFERS
];
ID3D11Buffer
*
mCurrentGeometryConstantBuffer
;
// Vertex, index and input layouts
// Vertex, index and input layouts
VertexDataManager
*
mVertexDataManager
;
VertexDataManager
*
mVertexDataManager
;
...
...
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