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
4d39dc62
Commit
4d39dc62
authored
Dec 20, 2018
by
Laszlo Agocs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Report dpr from rt
parent
0855a4d2
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
64 additions
and
2 deletions
+64
-2
src/rhi/qrhi.h
src/rhi/qrhi.h
+1
-0
src/rhi/qrhid3d11.cpp
src/rhi/qrhid3d11.cpp
+12
-1
src/rhi/qrhid3d11_p.h
src/rhi/qrhid3d11_p.h
+3
-0
src/rhi/qrhigles2.cpp
src/rhi/qrhigles2.cpp
+12
-0
src/rhi/qrhigles2_p.h
src/rhi/qrhigles2_p.h
+4
-1
src/rhi/qrhimetal.mm
src/rhi/qrhimetal.mm
+13
-0
src/rhi/qrhimetal_p.h
src/rhi/qrhimetal_p.h
+2
-0
src/rhi/qrhivulkan.cpp
src/rhi/qrhivulkan.cpp
+14
-0
src/rhi/qrhivulkan_p.h
src/rhi/qrhivulkan_p.h
+3
-0
No files found.
src/rhi/qrhi.h
View file @
4d39dc62
...
...
@@ -588,6 +588,7 @@ public:
virtual
Type
type
()
const
=
0
;
virtual
QSize
sizeInPixels
()
const
=
0
;
virtual
float
devicePixelRatio
()
const
=
0
;
QRhiRenderPassDescriptor
*
renderPassDescriptor
()
const
{
return
m_renderPassDesc
;
}
void
setRenderPassDescriptor
(
QRhiRenderPassDescriptor
*
desc
)
{
m_renderPassDesc
=
desc
;
}
...
...
src/rhi/qrhid3d11.cpp
View file @
4d39dc62
...
...
@@ -477,7 +477,6 @@ QRhi::FrameOpResult QRhiD3D11::beginFrame(QRhiSwapChain *swapChain)
contextState
.
currentSwapChain
=
swapChainD
;
swapChainD
->
cb
.
resetState
();
swapChainD
->
rt
.
d
.
pixelSize
=
swapChainD
->
pixelSize
;
swapChainD
->
rt
.
d
.
rtv
[
0
]
=
swapChainD
->
sampleDesc
.
Count
>
1
?
swapChainD
->
msaaRtv
[
swapChainD
->
currentFrame
]
:
swapChainD
->
rtv
[
swapChainD
->
currentFrame
];
swapChainD
->
rt
.
d
.
dsv
=
swapChainD
->
ds
?
swapChainD
->
ds
->
dsv
:
nullptr
;
...
...
@@ -1769,6 +1768,11 @@ QSize QD3D11ReferenceRenderTarget::sizeInPixels() const
return
d
.
pixelSize
;
}
float
QD3D11ReferenceRenderTarget
::
devicePixelRatio
()
const
{
return
d
.
dpr
;
}
QD3D11TextureRenderTarget
::
QD3D11TextureRenderTarget
(
QRhiImplementation
*
rhi
,
const
QRhiTextureRenderTargetDescription
&
desc
,
Flags
flags
)
...
...
@@ -1858,6 +1862,7 @@ bool QD3D11TextureRenderTarget::build()
Q_UNREACHABLE
();
}
}
d
.
dpr
=
1
;
if
(
hasDepthStencil
)
{
if
(
m_desc
.
depthTexture
)
{
...
...
@@ -1905,6 +1910,11 @@ QSize QD3D11TextureRenderTarget::sizeInPixels() const
return
d
.
pixelSize
;
}
float
QD3D11TextureRenderTarget
::
devicePixelRatio
()
const
{
return
d
.
dpr
;
}
QD3D11ShaderResourceBindings
::
QD3D11ShaderResourceBindings
(
QRhiImplementation
*
rhi
)
:
QRhiShaderResourceBindings
(
rhi
)
{
...
...
@@ -2567,6 +2577,7 @@ bool QD3D11SwapChain::buildOrResize()
QD3D11ReferenceRenderTarget
*
rtD
=
QRHI_RES
(
QD3D11ReferenceRenderTarget
,
&
rt
);
rtD
->
d
.
rp
=
QRHI_RES
(
QD3D11RenderPassDescriptor
,
m_renderPassDesc
);
rtD
->
d
.
pixelSize
=
pixelSize
;
rtD
->
d
.
dpr
=
window
->
devicePixelRatio
();
rtD
->
d
.
colorAttCount
=
1
;
rtD
->
d
.
dsAttCount
=
m_depthStencil
?
1
:
0
;
...
...
src/rhi/qrhid3d11_p.h
View file @
4d39dc62
...
...
@@ -124,6 +124,7 @@ struct QD3D11RenderTargetData
QD3D11RenderPassDescriptor
*
rp
=
nullptr
;
QSize
pixelSize
;
float
dpr
=
1
;
int
colorAttCount
=
0
;
int
dsAttCount
=
0
;
...
...
@@ -138,6 +139,7 @@ struct QD3D11ReferenceRenderTarget : public QRhiReferenceRenderTarget
void
release
()
override
;
Type
type
()
const
override
;
QSize
sizeInPixels
()
const
override
;
float
devicePixelRatio
()
const
override
;
QD3D11RenderTargetData
d
;
};
...
...
@@ -149,6 +151,7 @@ struct QD3D11TextureRenderTarget : public QRhiTextureRenderTarget
Type
type
()
const
override
;
QSize
sizeInPixels
()
const
override
;
float
devicePixelRatio
()
const
override
;
QRhiRenderPassDescriptor
*
newCompatibleRenderPassDescriptor
()
override
;
bool
build
()
override
;
...
...
src/rhi/qrhigles2.cpp
View file @
4d39dc62
...
...
@@ -1728,6 +1728,11 @@ QSize QGles2ReferenceRenderTarget::sizeInPixels() const
return
d
.
pixelSize
;
}
float
QGles2ReferenceRenderTarget
::
devicePixelRatio
()
const
{
return
d
.
dpr
;
}
QGles2TextureRenderTarget
::
QGles2TextureRenderTarget
(
QRhiImplementation
*
rhi
,
const
QRhiTextureRenderTargetDescription
&
desc
,
Flags
flags
)
...
...
@@ -1797,6 +1802,7 @@ bool QGles2TextureRenderTarget::build()
rhiD
->
f
->
glFramebufferRenderbuffer
(
GL_FRAMEBUFFER
,
GL_COLOR_ATTACHMENT0
,
GL_RENDERBUFFER
,
rbD
->
renderbuffer
);
d
.
pixelSize
=
rbD
->
pixelSize
();
}
d
.
dpr
=
1
;
if
(
m_desc
.
depthStencilBuffer
)
{
QGles2RenderBuffer
*
rbD
=
QRHI_RES
(
QGles2RenderBuffer
,
m_desc
.
depthStencilBuffer
);
...
...
@@ -1824,6 +1830,11 @@ QSize QGles2TextureRenderTarget::sizeInPixels() const
return
d
.
pixelSize
;
}
float
QGles2TextureRenderTarget
::
devicePixelRatio
()
const
{
return
d
.
dpr
;
}
QGles2ShaderResourceBindings
::
QGles2ShaderResourceBindings
(
QRhiImplementation
*
rhi
)
:
QRhiShaderResourceBindings
(
rhi
)
{
...
...
@@ -2058,6 +2069,7 @@ bool QGles2SwapChain::buildOrResize()
rt
.
d
.
rp
=
QRHI_RES
(
QGles2RenderPassDescriptor
,
m_renderPassDesc
);
rt
.
d
.
pixelSize
=
pixelSize
;
rt
.
d
.
dpr
=
m_window
->
devicePixelRatio
();
rt
.
d
.
attCount
=
m_depthStencil
?
2
:
1
;
return
true
;
...
...
src/rhi/qrhigles2_p.h
View file @
4d39dc62
...
...
@@ -132,7 +132,8 @@ struct QGles2BasicRenderTargetData
QGles2RenderPassDescriptor
*
rp
=
nullptr
;
QSize
pixelSize
;
int
attCount
;
float
dpr
=
1
;
int
attCount
=
0
;
};
struct
QGles2ReferenceRenderTarget
:
public
QRhiReferenceRenderTarget
...
...
@@ -141,6 +142,7 @@ struct QGles2ReferenceRenderTarget : public QRhiReferenceRenderTarget
void
release
()
override
;
Type
type
()
const
override
;
QSize
sizeInPixels
()
const
override
;
float
devicePixelRatio
()
const
override
;
QGles2BasicRenderTargetData
d
;
};
...
...
@@ -152,6 +154,7 @@ struct QGles2TextureRenderTarget : public QRhiTextureRenderTarget
Type
type
()
const
override
;
QSize
sizeInPixels
()
const
override
;
float
devicePixelRatio
()
const
override
;
QRhiRenderPassDescriptor
*
newCompatibleRenderPassDescriptor
()
override
;
bool
build
()
override
;
...
...
src/rhi/qrhimetal.mm
View file @
4d39dc62
...
...
@@ -162,6 +162,7 @@ struct QMetalCommandBufferData
struct
QMetalRenderTargetData
{
QSize
pixelSize
;
float
dpr
=
1
;
int
colorAttCount
=
0
;
int
dsAttCount
=
0
;
...
...
@@ -1629,6 +1630,11 @@ QSize QMetalReferenceRenderTarget::sizeInPixels() const
return
d
->
pixelSize
;
}
float
QMetalReferenceRenderTarget
::
devicePixelRatio
()
const
{
return
d
->
dpr
;
}
QMetalTextureRenderTarget
::
QMetalTextureRenderTarget
(
QRhiImplementation
*
rhi
,
const
QRhiTextureRenderTargetDescription
&
desc
,
Flags
flags
)
...
...
@@ -1693,6 +1699,7 @@ bool QMetalTextureRenderTarget::build()
d
->
fb
.
colorAtt
[
i
]
=
{
dst
,
m_desc
.
colorAttachments
[
i
].
layer
,
m_desc
.
colorAttachments
[
i
].
level
,
resDst
,
m_desc
.
colorAttachments
[
i
].
resolveLayer
,
m_desc
.
colorAttachments
[
i
].
resolveLevel
};
}
d
->
dpr
=
1
;
if
(
hasDepthStencil
)
{
if
(
m_desc
.
depthTexture
)
{
...
...
@@ -1724,6 +1731,11 @@ QSize QMetalTextureRenderTarget::sizeInPixels() const
return
d
->
pixelSize
;
}
float
QMetalTextureRenderTarget
::
devicePixelRatio
()
const
{
return
d
->
dpr
;
}
QMetalShaderResourceBindings
::
QMetalShaderResourceBindings
(
QRhiImplementation
*
rhi
)
:
QRhiShaderResourceBindings
(
rhi
)
{
...
...
@@ -2370,6 +2382,7 @@ bool QMetalSwapChain::buildOrResize()
}
rtWrapper
.
d
->
pixelSize
=
pixelSize
;
rtWrapper
.
d
->
dpr
=
window
->
devicePixelRatio
();
rtWrapper
.
d
->
colorAttCount
=
1
;
rtWrapper
.
d
->
dsAttCount
=
ds
?
1
:
0
;
...
...
src/rhi/qrhimetal_p.h
View file @
4d39dc62
...
...
@@ -143,6 +143,7 @@ struct QMetalReferenceRenderTarget : public QRhiReferenceRenderTarget
Type
type
()
const
override
;
QSize
sizeInPixels
()
const
override
;
float
devicePixelRatio
()
const
override
;
QMetalRenderTargetData
*
d
;
};
...
...
@@ -155,6 +156,7 @@ struct QMetalTextureRenderTarget : public QRhiTextureRenderTarget
Type
type
()
const
override
;
QSize
sizeInPixels
()
const
override
;
float
devicePixelRatio
()
const
override
;
QRhiRenderPassDescriptor
*
newCompatibleRenderPassDescriptor
()
override
;
bool
build
()
override
;
...
...
src/rhi/qrhivulkan.cpp
View file @
4d39dc62
...
...
@@ -1188,6 +1188,7 @@ QRhi::FrameOpResult QRhiVulkan::beginWrapperFrame(QRhiSwapChain *swapChain)
swapChainD
->
rtWrapper
.
d
.
fb
=
w
->
currentFramebuffer
();
swapChainD
->
m_currentPixelSize
=
swapChainD
->
pixelSize
=
swapChainD
->
rtWrapper
.
d
.
pixelSize
=
w
->
swapChainImageSize
();
swapChainD
->
rtWrapper
.
d
.
dpr
=
w
->
devicePixelRatio
();
currentFrameSlot
=
w
->
currentFrame
();
currentSwapChain
=
swapChainD
;
...
...
@@ -3574,6 +3575,11 @@ QSize QVkReferenceRenderTarget::sizeInPixels() const
return
d
.
pixelSize
;
}
float
QVkReferenceRenderTarget
::
devicePixelRatio
()
const
{
return
d
.
dpr
;
}
QVkTextureRenderTarget
::
QVkTextureRenderTarget
(
QRhiImplementation
*
rhi
,
const
QRhiTextureRenderTargetDescription
&
desc
,
Flags
flags
)
...
...
@@ -3679,6 +3685,7 @@ bool QVkTextureRenderTarget::build()
Q_UNREACHABLE
();
}
}
d
.
dpr
=
1
;
if
(
hasDepthStencil
)
{
d
.
dsAttCount
=
1
;
...
...
@@ -3757,6 +3764,11 @@ QSize QVkTextureRenderTarget::sizeInPixels() const
return
d
.
pixelSize
;
}
float
QVkTextureRenderTarget
::
devicePixelRatio
()
const
{
return
d
.
dpr
;
}
QVkShaderResourceBindings
::
QVkShaderResourceBindings
(
QRhiImplementation
*
rhi
)
:
QRhiShaderResourceBindings
(
rhi
)
{
...
...
@@ -4218,6 +4230,7 @@ bool QVkSwapChain::buildOrResize()
rtWrapper
.
d
.
rp
=
QRHI_RES
(
QVkRenderPassDescriptor
,
m_renderPassDesc
);
Q_ASSERT
(
rtWrapper
.
d
.
rp
&&
rtWrapper
.
d
.
rp
->
rp
);
m_currentPixelSize
=
pixelSize
=
rtWrapper
.
d
.
pixelSize
=
vkw
->
swapChainImageSize
();
rtWrapper
.
d
.
dpr
=
vkw
->
devicePixelRatio
();
rtWrapper
.
d
.
colorAttCount
=
1
;
rtWrapper
.
d
.
dsAttCount
=
1
;
rtWrapper
.
d
.
resolveAttCount
=
vkw
->
sampleCountFlagBits
()
>
VK_SAMPLE_COUNT_1_BIT
?
1
:
0
;
...
...
@@ -4263,6 +4276,7 @@ bool QVkSwapChain::buildOrResize()
Q_ASSERT
(
rtWrapper
.
d
.
rp
&&
rtWrapper
.
d
.
rp
->
rp
);
rtWrapper
.
d
.
pixelSize
=
pixelSize
;
rtWrapper
.
d
.
dpr
=
window
->
devicePixelRatio
();
rtWrapper
.
d
.
colorAttCount
=
1
;
if
(
m_depthStencil
)
{
rtWrapper
.
d
.
dsAttCount
=
1
;
...
...
src/rhi/qrhivulkan_p.h
View file @
4d39dc62
...
...
@@ -146,6 +146,7 @@ struct QVkRenderTargetData
VkFramebuffer
fb
=
VK_NULL_HANDLE
;
QVkRenderPassDescriptor
*
rp
=
nullptr
;
QSize
pixelSize
;
float
dpr
=
1
;
int
colorAttCount
=
0
;
int
dsAttCount
=
0
;
int
resolveAttCount
=
0
;
...
...
@@ -158,6 +159,7 @@ struct QVkReferenceRenderTarget : public QRhiReferenceRenderTarget
void
release
()
override
;
Type
type
()
const
override
;
QSize
sizeInPixels
()
const
override
;
float
devicePixelRatio
()
const
override
;
QVkRenderTargetData
d
;
};
...
...
@@ -169,6 +171,7 @@ struct QVkTextureRenderTarget : public QRhiTextureRenderTarget
Type
type
()
const
override
;
QSize
sizeInPixels
()
const
override
;
float
devicePixelRatio
()
const
override
;
QRhiRenderPassDescriptor
*
newCompatibleRenderPassDescriptor
()
override
;
bool
build
()
override
;
...
...
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