Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Laszlo Agocs
qtrhi
Commits
4d35b6d0
Commit
4d35b6d0
authored
Jan 08, 2019
by
Laszlo Agocs
Browse files
Work around surface vs window size mess (vk, d3d)
parent
fb039278
Changes
7
Hide whitespace changes
Inline
Side-by-side
examples/rhi/hellominimalcrossgfxtriangle/hellominimalcrossgfxtriangle.cpp
View file @
4d35b6d0
...
...
@@ -208,12 +208,13 @@ void Window::exposeEvent(QExposeEvent *)
render
();
}
// stop pushing frames when not exposed (o
n some platforms this is essential, optional on others
)
if
(
!
isExposed
()
&&
m_running
)
// stop pushing frames when not exposed (o
r size is 0
)
if
(
(
!
isExposed
()
||
(
m_hasSwapChain
&&
m_sc
->
surfacePixelSize
().
isEmpty
()))
&&
m_running
)
m_notExposed
=
true
;
// continue when exposed again
if
(
isExposed
()
&&
m_running
&&
m_notExposed
)
{
// continue when exposed again and the surface has a valid size.
// note that the surface size can be (0, 0) even though size() reports a valid one...
if
(
isExposed
()
&&
m_running
&&
m_notExposed
&&
!
m_sc
->
surfacePixelSize
().
isEmpty
())
{
m_notExposed
=
false
;
m_newlyExposed
=
true
;
render
();
...
...
examples/rhi/shared/examplefw.h
View file @
4d35b6d0
...
...
@@ -199,12 +199,13 @@ void Window::exposeEvent(QExposeEvent *)
render
();
}
// stop pushing frames when not exposed (o
n some platforms this is essential, optional on others
)
if
(
!
isExposed
()
&&
m_running
)
// stop pushing frames when not exposed (o
r size is 0
)
if
(
(
!
isExposed
()
||
(
m_hasSwapChain
&&
m_sc
->
surfacePixelSize
().
isEmpty
()))
&&
m_running
)
m_notExposed
=
true
;
// continue when exposed again
if
(
isExposed
()
&&
m_running
&&
m_notExposed
)
{
// continue when exposed again and the surface has a valid size.
// note that the surface size can be (0, 0) even though size() reports a valid one...
if
(
isExposed
()
&&
m_running
&&
m_notExposed
&&
!
m_sc
->
surfacePixelSize
().
isEmpty
())
{
m_notExposed
=
false
;
m_newlyExposed
=
true
;
render
();
...
...
src/rhi/qrhid3d11.cpp
View file @
4d35b6d0
...
...
@@ -1621,6 +1621,9 @@ bool QD3D11RenderBuffer::build()
if
(
tex
)
release
();
if
(
m_pixelSize
.
isEmpty
())
return
false
;
QRHI_RES_RHI
(
QRhiD3D11
);
sampleDesc
=
rhiD
->
effectiveSampleCount
(
m_sampleCount
);
...
...
@@ -2763,6 +2766,9 @@ bool QD3D11SwapChain::buildOrResize()
m_currentPixelSize
=
surfacePixelSize
();
pixelSize
=
m_currentPixelSize
;
if
(
pixelSize
.
isEmpty
())
return
false
;
colorFormat
=
DXGI_FORMAT_R8G8B8A8_UNORM
;
const
DXGI_FORMAT
srgbAdjustedFormat
=
m_flags
.
testFlag
(
sRGB
)
?
DXGI_FORMAT_R8G8B8A8_UNORM_SRGB
:
DXGI_FORMAT_R8G8B8A8_UNORM
;
...
...
src/rhi/qrhigles2.cpp
View file @
4d35b6d0
...
...
@@ -1622,6 +1622,9 @@ bool QGles2RenderBuffer::build()
qWarning
(
"RenderBuffer: UsedWithSwapChainOnly is meaningless in combination with Color"
);
}
if
(
m_pixelSize
.
isEmpty
())
return
false
;
if
(
!
rhiD
->
ensureContext
())
return
false
;
...
...
src/rhi/qrhimetal.mm
View file @
4d35b6d0
...
...
@@ -1379,6 +1379,9 @@ bool QMetalRenderBuffer::build()
if
(
d
->
tex
)
release
();
if
(
m_pixelSize
.
isEmpty
())
return
false
;
QRHI_RES_RHI
(
QRhiMetal
);
samples
=
rhiD
->
effectiveSampleCount
(
m_sampleCount
);
...
...
src/rhi/qrhivulkan.cpp
View file @
4d35b6d0
...
...
@@ -3525,6 +3525,9 @@ bool QVkRenderBuffer::build()
if
(
memory
||
backingTexture
)
release
();
if
(
m_pixelSize
.
isEmpty
())
return
false
;
QRHI_RES_RHI
(
QRhiVulkan
);
QRHI_PROF
;
samples
=
rhiD
->
effectiveSampleCount
(
m_sampleCount
);
...
...
todo.txt
View file @
4d35b6d0
prof report api (fed by a cbor stream)
mtl: report readback temp buf
multiwindow_threaded should demo pulling out the device and importing to another rhi
mtl: reduce set*
...
...
@@ -7,7 +6,6 @@ gl: tex formats (texture, readback)
gl: srgb
should istexformatsupported should check srgb combinations
vk: image in wrong layout when beginFrame-endFrame without a pass in it
vk: rendering hangs sometimes when minimize and back on some systems?
mtl: cbuffers, textures, samplers set should be batched too
cbuffer alignment rules - some things fail to translate (to hlsl e.g. with structs), which is fine but how to mitigate
what does image copy do for compressed formats?
...
...
@@ -20,16 +18,15 @@ gl: more ubuf types
more QImage->tex formats
if tex adjust its size (e.g. npot on gl), should QImage get scaled automatically?
d3d, gl, mtl: cache shader sources?
resize to 0 width or height fails (vk)
gl: ubuf structs, arrays
gl: target QOpenGLWindow/Widget?
compute?
vk: support instanceStepRate via VK_EXT_vertex_attribute_divisor
test cubemap face as target
test cubemap face readback
object names for other than buf/rb/tex
optional:
compute?
gl: target QOpenGLWindow/Widget?
threading options? secondary command lists?
copy/transfer queue?
vkmemalloc block size config?
...
...
@@ -51,6 +48,8 @@ dxc for d3d as an alternative to fxc?
hlsl -> dxc -> spirv -> spirv-cross hmmm...
+++ done
resize to 0 width or height fails (vk, d3d)
vk: rendering hangs sometimes when minimize and back on some systems?
allow requesting no-vsync present mode where applicable
d3d: timestamp query
vk: timestamp query
...
...
Write
Preview
Supports
Markdown
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