Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
qtrhi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Laszlo Agocs
qtrhi
Commits
0b0a698e
Commit
0b0a698e
authored
Feb 18, 2019
by
Laszlo Agocs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a feature value for non-dynamic cbuffers
Because we do not currently deal with this on d3d11.
parent
d6cc3e6a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
8 deletions
+29
-8
src/rhi/qrhi.cpp
src/rhi/qrhi.cpp
+19
-7
src/rhi/qrhi.h
src/rhi/qrhi.h
+2
-1
src/rhi/qrhid3d11.cpp
src/rhi/qrhid3d11.cpp
+2
-0
src/rhi/qrhigles2.cpp
src/rhi/qrhigles2.cpp
+2
-0
src/rhi/qrhimetal.mm
src/rhi/qrhimetal.mm
+2
-0
src/rhi/qrhivulkan.cpp
src/rhi/qrhivulkan.cpp
+2
-0
No files found.
src/rhi/qrhi.cpp
View file @
0b0a698e
...
...
@@ -336,6 +336,13 @@ QT_BEGIN_NAMESPACE
\value TessellationShaders Indicates that tessellation control and
evaluation shaders are supported.
\value NonDynamicUniformBuffers Indicates that creating buffers with the
usage \l{QRhiBuffer::UniformBuffer}{UniformBuffer} and the types
\l{QRhiBuffer::Immutable}{Immutable} or \l{QRhiBuffer::Static}{Static} is
supported. When reported as unsupported, uniform (constant) buffers must be
created as \l{QRhiBuffer::Dynamic}{Dynamic}. (which is recommended
regardless)
*/
/*!
...
...
@@ -1601,28 +1608,30 @@ bool QRhiResource::isShareable() const
/*!
\enum QRhiBuffer::Type
Specifies type of buffer resource.
Specifies
storage
type of buffer resource.
\value Immutable Indicates that the data is not expected to change ever
after the initial upload. Under the hood such buffer resources are
typically placed in device local (GPU) memory (on systems where
applicable). Uploading new data is possible, but
frequent changes can b
e
expensive. Upload typically happens by copying to a separate, host visible
staging buffer from which a GPU buffer-to-buffer copy is issued into the
actual
GPU-only buffer.
applicable). Uploading new data is possible, but
may be expensive. Th
e
upload typically happens by copying to a separate, host visible staging
buffer from which a GPU buffer-to-buffer copy is issued into the actual
GPU-only buffer.
\value Static Indicates that the data is expected to change only
infrequently. Typically placed in device local (GPU) memory, where
applicable. On backends where host visible staging buffers are used for
uploading, the staging buffers are kept around for this type, unlike with
Immutable, so subsequent uploads do not suffer in performance. Frequent
updates should be avoided.
updates
, especially updates in consecutive frames,
should be avoided.
\value Dynamic Indicates that the data is expected to change frequently.
Not recommended for large buffers. Typically backed by host visible memory
in 2 copies in order to allow for changing without stalling the graphics
pipeline. The double buffering is managed transparently to the applications
and is not exposed in the API here in any form.
and is not exposed in the API here in any form. This is the recommended,
and, with some backends, the only possible, type for buffers with
UniformBuffer usage.
*/
/*!
...
...
@@ -4141,6 +4150,9 @@ QRhiShaderResourceBindings *QRhi::newShaderResourceBindings()
/*!
\return a new buffer with the specified \a type, \a usage, and \a size.
\note Some \a usage and \a type combinations may not be supported by all
backends. See \l{QRhi::NonDynamicUniformBuffers}{the feature flags}.
\sa QRhiResource::release(), QRhiResource::releaseAndDestroy()
*/
QRhiBuffer
*
QRhi
::
newBuffer
(
QRhiBuffer
::
Type
type
,
...
...
src/rhi/qrhi.h
View file @
0b0a698e
...
...
@@ -1243,7 +1243,8 @@ public:
CustomInstanceStepRate
,
PrimitiveRestart
,
GeometryShaders
,
TessellationShaders
TessellationShaders
,
NonDynamicUniformBuffers
};
enum
BeginFrameFlag
{
...
...
src/rhi/qrhid3d11.cpp
View file @
0b0a698e
...
...
@@ -395,6 +395,8 @@ bool QRhiD3D11::isFeatureSupported(QRhi::Feature feature) const
return
false
;
// for now
case
QRhi
::
TessellationShaders
:
return
false
;
// for now
case
QRhi
::
NonDynamicUniformBuffers
:
return
false
;
// because UpdateSubresource cannot deal with this
default:
Q_UNREACHABLE
();
return
false
;
...
...
src/rhi/qrhigles2.cpp
View file @
0b0a698e
...
...
@@ -505,6 +505,8 @@ bool QRhiGles2::isFeatureSupported(QRhi::Feature feature) const
return
false
;
case
QRhi
::
TessellationShaders
:
return
false
;
case
QRhi
::
NonDynamicUniformBuffers
:
return
true
;
default:
Q_UNREACHABLE
();
return
false
;
...
...
src/rhi/qrhimetal.mm
View file @
0b0a698e
...
...
@@ -512,6 +512,8 @@ bool QRhiMetal::isFeatureSupported(QRhi::Feature feature) const
return
false
;
case
QRhi
::
TessellationShaders
:
return
false
;
// for now
case
QRhi
::
NonDynamicUniformBuffers
:
return
true
;
default:
Q_UNREACHABLE
();
return
false
;
...
...
src/rhi/qrhivulkan.cpp
View file @
0b0a698e
...
...
@@ -3033,6 +3033,8 @@ bool QRhiVulkan::isFeatureSupported(QRhi::Feature feature) const
return
true
;
case
QRhi
::
TessellationShaders
:
return
true
;
case
QRhi
::
NonDynamicUniformBuffers
:
return
true
;
default:
Q_UNREACHABLE
();
return
false
;
...
...
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