Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Laszlo Agocs
qtrhi
Commits
0856f98d
Commit
0856f98d
authored
Feb 08, 2019
by
Laszlo Agocs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make srb debug printable
parent
0a1f38d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
0 deletions
+56
-0
src/rhi/qrhi.cpp
src/rhi/qrhi.cpp
+43
-0
src/rhi/qrhi.h
src/rhi/qrhi.h
+13
-0
No files found.
src/rhi/qrhi.cpp
View file @
0856f98d
...
...
@@ -1982,6 +1982,49 @@ uint qHash(const QRhiShaderResourceBinding &b, uint seed)
+
qHash
(
QByteArray
::
fromRawData
(
u
,
sizeof
(
b
.
d
->
u
)),
seed
);
}
#ifndef QT_NO_DEBUG_STREAM
QDebug
operator
<<
(
QDebug
dbg
,
const
QRhiShaderResourceBinding
&
b
)
{
const
QRhiShaderResourceBindingPrivate
*
d
=
b
.
d
;
QDebugStateSaver
saver
(
dbg
);
dbg
.
nospace
()
<<
"QRhiShaderResourceBinding("
<<
"binding="
<<
d
->
binding
<<
" stage="
<<
d
->
stage
<<
" type="
<<
d
->
type
;
switch
(
d
->
type
)
{
case
QRhiShaderResourceBinding
::
UniformBuffer
:
dbg
.
nospace
()
<<
" UniformBuffer("
<<
"buffer="
<<
d
->
u
.
ubuf
.
buf
<<
" offset="
<<
d
->
u
.
ubuf
.
offset
<<
" maybeSize="
<<
d
->
u
.
ubuf
.
maybeSize
<<
')'
;
break
;
case
QRhiShaderResourceBinding
::
SampledTexture
:
dbg
.
nospace
()
<<
" SampledTexture("
<<
"texture="
<<
d
->
u
.
stex
.
tex
<<
" sampler="
<<
d
->
u
.
stex
.
sampler
<<
')'
;
break
;
default:
Q_UNREACHABLE
();
break
;
}
dbg
.
nospace
()
<<
')'
;
return
dbg
;
}
#endif
#ifndef QT_NO_DEBUG_STREAM
QDebug
operator
<<
(
QDebug
dbg
,
const
QRhiShaderResourceBindings
&
srb
)
{
QDebugStateSaver
saver
(
dbg
);
dbg
.
nospace
()
<<
"QRhiShaderResourceBindings("
<<
srb
.
m_bindings
<<
')'
;
return
dbg
;
}
#endif
/*!
\class QRhiGraphicsPipeline
\inmodule QtRhi
...
...
src/rhi/qrhi.h
View file @
0856f98d
...
...
@@ -280,6 +280,9 @@ private:
friend
Q_RHI_EXPORT
bool
operator
==
(
const
QRhiShaderResourceBinding
&
,
const
QRhiShaderResourceBinding
&
);
friend
Q_RHI_EXPORT
bool
operator
!=
(
const
QRhiShaderResourceBinding
&
,
const
QRhiShaderResourceBinding
&
);
friend
Q_RHI_EXPORT
uint
qHash
(
const
QRhiShaderResourceBinding
&
,
uint
);
#ifndef QT_NO_DEBUG_STREAM
friend
Q_RHI_EXPORT
QDebug
operator
<<
(
QDebug
,
const
QRhiShaderResourceBinding
&
);
#endif
};
Q_DECLARE_OPERATORS_FOR_FLAGS
(
QRhiShaderResourceBinding
::
StageFlags
)
...
...
@@ -287,6 +290,9 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiShaderResourceBinding::StageFlags)
Q_RHI_EXPORT
bool
operator
==
(
const
QRhiShaderResourceBinding
&
a
,
const
QRhiShaderResourceBinding
&
b
);
Q_RHI_EXPORT
bool
operator
!=
(
const
QRhiShaderResourceBinding
&
a
,
const
QRhiShaderResourceBinding
&
b
);
Q_RHI_EXPORT
uint
qHash
(
const
QRhiShaderResourceBinding
&
b
,
uint
seed
=
0
);
#ifndef QT_NO_DEBUG_STREAM
Q_RHI_EXPORT
QDebug
operator
<<
(
QDebug
,
const
QRhiShaderResourceBinding
&
);
#endif
class
Q_RHI_EXPORT
QRhiColorAttachment
{
...
...
@@ -786,8 +792,15 @@ protected:
QRhiShaderResourceBindings
(
QRhiImplementation
*
rhi
);
QVector
<
QRhiShaderResourceBinding
>
m_bindings
;
Q_DECL_UNUSED_MEMBER
quint64
m_reserved
;
#ifndef QT_NO_DEBUG_STREAM
friend
Q_RHI_EXPORT
QDebug
operator
<<
(
QDebug
,
const
QRhiShaderResourceBindings
&
);
#endif
};
#ifndef QT_NO_DEBUG_STREAM
Q_RHI_EXPORT
QDebug
operator
<<
(
QDebug
,
const
QRhiShaderResourceBindings
&
);
#endif
class
Q_RHI_EXPORT
QRhiGraphicsPipeline
:
public
QRhiResource
{
public:
...
...
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