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
75accb90
Commit
75accb90
authored
Jan 05, 2019
by
Laszlo Agocs
Browse files
mtl: report a proper max texture size
try to deal with the nonsense feature set api
parent
5bf111aa
Changes
3
Show whitespace changes
Inline
Side-by-side
src/rhi/qrhimetal.mm
View file @
75accb90
...
...
@@ -240,6 +240,29 @@ bool QRhiMetal::create(QRhi::Flags flags)
d
->
cmdQueue
=
[
d
->
dev
newCommandQueue
];
#if defined(Q_OS_MACOS)
caps
.
maxTextureSize
=
16384
;
#elif defined(Q_OS_TVOS)
if
([
d
->
dev
supportsFeatureSet
:
MTLFeatureSet
(
30003
)])
// MTLFeatureSet_tvOS_GPUFamily2_v1
caps
.
maxTextureSize
=
16384
;
else
caps
.
maxTextureSize
=
8192
;
#elif defined(Q_OS_IOS)
// welcome to feature set hell
if
([
d
->
dev
supportsFeatureSet
:
MTLFeatureSet
(
16
)]
// MTLFeatureSet_iOS_GPUFamily5_v1
||
[
d
->
dev
supportsFeatureSet
:
MTLFeatureSet
(
11
)]
// MTLFeatureSet_iOS_GPUFamily4_v1
||
[
d
->
dev
supportsFeatureSet
:
MTLFeatureSet
(
4
)])
// MTLFeatureSet_iOS_GPUFamily3_v1
{
caps
.
maxTextureSize
=
16384
;
}
else
if
([
d
->
dev
supportsFeatureSet
:
MTLFeatureSet
(
3
)]
// MTLFeatureSet_iOS_GPUFamily2_v2
||
[
d
->
dev
supportsFeatureSet
:
MTLFeatureSet
(
2
)])
// MTLFeatureSet_iOS_GPUFamily1_v2
{
caps
.
maxTextureSize
=
8192
;
}
else
{
caps
.
maxTextureSize
=
4096
;
}
#endif
nativeHandlesStruct
.
dev
=
d
->
dev
;
nativeHandlesStruct
.
cmdQueue
=
d
->
cmdQueue
;
...
...
@@ -348,7 +371,7 @@ int QRhiMetal::resourceSizeLimit(QRhi::ResourceSizeLimit limit) const
case
QRhi
::
TextureSizeMin
:
return
1
;
case
QRhi
::
TextureSizeMax
:
return
16384
;
// ###
return
caps
.
maxTextureSize
;
default:
Q_UNREACHABLE
();
return
0
;
...
...
src/rhi/qrhimetal_p.h
View file @
75accb90
...
...
@@ -344,6 +344,10 @@ public:
QSet
<
QMetalSwapChain
*>
swapchains
;
QRhiMetalNativeHandles
nativeHandlesStruct
;
struct
{
int
maxTextureSize
=
4096
;
}
caps
;
QRhiMetalData
*
d
=
nullptr
;
};
...
...
todo.txt
View file @
75accb90
prof report api (fed by a cbor stream)
gl: debug: object names
gl: debug: markers (begin, end, msg)
mtl: max texture size
prof: report readback temp buf
multiwindow_threaded should demo pulling out the device and importing to another rhi
merge offscreen examples into one
...
...
@@ -54,6 +53,7 @@ dxc for d3d as an alternative to fxc?
hlsl -> dxc -> spirv -> spirv-cross hmmm...
+++ done
mtl: max texture size
vk: obj name and debug markers
vk, gl: tex and other prof
max texture size stuff
...
...
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