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
0efdb544
Commit
0efdb544
authored
Nov 07, 2018
by
Laszlo Agocs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor corrections in comments
parent
9c79d004
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
9 deletions
+14
-9
examples/rhi/hellominimalcrossgfxtriangle/hellominimalcrossgfxtriangle.cpp
...ominimalcrossgfxtriangle/hellominimalcrossgfxtriangle.cpp
+6
-3
src/rhi/qrhid3d11.cpp
src/rhi/qrhid3d11.cpp
+1
-1
src/rhi/qrhimetal.mm
src/rhi/qrhimetal.mm
+6
-4
src/rhi/qrhivulkan.cpp
src/rhi/qrhivulkan.cpp
+1
-1
No files found.
examples/rhi/hellominimalcrossgfxtriangle/hellominimalcrossgfxtriangle.cpp
View file @
0efdb544
...
...
@@ -433,7 +433,10 @@ void Window::render()
m_newlyExposed
=
false
;
}
// Start a new frame. This is where we block when too far ahead of GPU/present.
// Start a new frame. This is where we block when too far ahead of
// GPU/present, and that's what throttles the thread to the refresh rate.
// (except for OpenGL where it happens either in endFrame or somewhere else
// depending on the GL implementation)
QRhi
::
FrameOpResult
r
=
m_r
->
beginFrame
(
m_sc
);
if
(
r
==
QRhi
::
FrameOpSwapChainOutOfDate
)
{
resizeSwapChain
();
...
...
@@ -476,11 +479,11 @@ void Window::render()
QRhiCommandBuffer
*
cb
=
m_sc
->
currentFrameCommandBuffer
();
const
QSize
outputSizeInPixels
=
m_sc
->
effectivePixelSize
();
// Apply buffer
/texture
updates, clear,
queue
the renderpass
begin
(where applicable).
// Apply buffer updates, clear,
start
the renderpass (where applicable).
m_r
->
beginPass
(
m_sc
->
currentFrameRenderTarget
(),
cb
,
{
0.4
f
,
0.7
f
,
0.0
f
,
1.0
f
},
{
1.0
f
,
0
},
u
);
m_r
->
setGraphicsPipeline
(
cb
,
m_ps
);
m_r
->
setViewport
(
cb
,
QRhiViewport
(
0
,
0
,
outputSizeInPixels
.
width
(),
outputSizeInPixels
.
height
()));
m_r
->
setViewport
(
cb
,
{
0
,
0
,
float
(
outputSizeInPixels
.
width
()
)
,
float
(
outputSizeInPixels
.
height
())
}
);
m_r
->
setVertexInput
(
cb
,
0
,
{
{
m_vbuf
,
0
}
});
m_r
->
draw
(
cb
,
3
);
...
...
src/rhi/qrhid3d11.cpp
View file @
0efdb544
...
...
@@ -319,7 +319,7 @@ void QRhiD3D11::setViewport(QRhiCommandBuffer *cb, const QRhiViewport &viewport)
QD3D11CommandBuffer
::
Command
cmd
;
cmd
.
cmd
=
QD3D11CommandBuffer
::
Command
::
Viewport
;
cmd
.
args
.
viewport
.
x
=
viewport
.
r
.
x
();
// d3d expects top-left, QRhi
Sciss
or is bottom-left
// d3d expects top-left, QRhi
Viewp
or
t
is bottom-left
cmd
.
args
.
viewport
.
y
=
cbD
->
currentTarget
->
sizeInPixels
().
height
()
-
(
viewport
.
r
.
y
()
+
viewport
.
r
.
w
()
-
1
);
cmd
.
args
.
viewport
.
y
=
viewport
.
r
.
y
();
cmd
.
args
.
viewport
.
w
=
viewport
.
r
.
z
();
...
...
src/rhi/qrhimetal.mm
View file @
0efdb544
...
...
@@ -46,9 +46,9 @@
QT_BEGIN_NAMESPACE
/*
Metal backend.
MRC.
Double buffers and throttles to vsync. "Dynamic"
buffers are
Shared (host visible) and duplicated (due to 2 frames in
flight), while
"static" buffers are
###
Metal backend. Double buffers and throttles to vsync. "Dynamic"
buffers are
Shared (host visible) and duplicated (due to 2 frames in
flight), while
"static" buffers are
Managed on macOS and Shared on iOS/tvOS.
*/
#if __has_feature(objc_arc)
...
...
@@ -621,7 +621,9 @@ bool QMetalBuffer::build()
const
int
roundedSize
=
m_usage
.
testFlag
(
QRhiBuffer
::
UniformBuffer
)
?
aligned
(
m_size
,
256
)
:
m_size
;
MTLResourceOptions
opts
=
MTLResourceStorageModeShared
;
// ### for now everything host visible and double buffered
// ### for now everything host visible and double buffered
// should instead use Managed on macOS for immutable/static
MTLResourceOptions
opts
=
MTLResourceStorageModeShared
;
QRHI_RES_RHI
(
QRhiMetal
);
for
(
int
i
=
0
;
i
<
QMTL_FRAMES_IN_FLIGHT
;
++
i
)
{
...
...
src/rhi/qrhivulkan.cpp
View file @
0efdb544
...
...
@@ -2912,7 +2912,7 @@ bool QVkTextureRenderTarget::build()
QRhiRenderTarget
::
Type
QVkTextureRenderTarget
::
type
()
const
{
return
RtTexture
;
// this is a QVkTextureRenderTarget, owns fb and rp
return
RtTexture
;
}
QSize
QVkTextureRenderTarget
::
sizeInPixels
()
const
...
...
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