Commit 41c645f2 authored by Laszlo Agocs's avatar Laszlo Agocs

mtl: make buf/rb/tex/smp shareable

parent 7fa0a9bc
...@@ -563,6 +563,8 @@ int main(int argc, char **argv) ...@@ -563,6 +563,8 @@ int main(int argc, char **argv)
windowA.setPosition(windowA.position() - QPoint(200, 200)); windowA.setPosition(windowA.position() - QPoint(200, 200));
windowB.setPosition(windowB.position() + QPoint(200, 200)); windowB.setPosition(windowB.position() + QPoint(200, 200));
windowA.raise();
windowB.raise();
result = app.exec(); result = app.exec();
} }
......
This diff is collapsed.
...@@ -57,6 +57,7 @@ struct QMetalBuffer : public QRhiBuffer ...@@ -57,6 +57,7 @@ struct QMetalBuffer : public QRhiBuffer
{ {
QMetalBuffer(QRhiImplementation *rhi, Type type, UsageFlags usage, int size); QMetalBuffer(QRhiImplementation *rhi, Type type, UsageFlags usage, int size);
~QMetalBuffer(); ~QMetalBuffer();
bool isShareable() const override;
void release() override; void release() override;
bool build() override; bool build() override;
...@@ -73,6 +74,7 @@ struct QMetalRenderBuffer : public QRhiRenderBuffer ...@@ -73,6 +74,7 @@ struct QMetalRenderBuffer : public QRhiRenderBuffer
QMetalRenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize, QMetalRenderBuffer(QRhiImplementation *rhi, Type type, const QSize &pixelSize,
int sampleCount, QRhiRenderBuffer::Flags flags); int sampleCount, QRhiRenderBuffer::Flags flags);
~QMetalRenderBuffer(); ~QMetalRenderBuffer();
bool isShareable() const override;
void release() override; void release() override;
bool build() override; bool build() override;
QRhiTexture::Format backingFormat() const override; QRhiTexture::Format backingFormat() const override;
...@@ -91,6 +93,7 @@ struct QMetalTexture : public QRhiTexture ...@@ -91,6 +93,7 @@ struct QMetalTexture : public QRhiTexture
QMetalTexture(QRhiImplementation *rhi, Format format, const QSize &pixelSize, QMetalTexture(QRhiImplementation *rhi, Format format, const QSize &pixelSize,
int sampleCount, Flags flags); int sampleCount, Flags flags);
~QMetalTexture(); ~QMetalTexture();
bool isShareable() const override;
void release() override; void release() override;
bool build() override; bool build() override;
bool buildFrom(const QRhiNativeHandles *src) override; bool buildFrom(const QRhiNativeHandles *src) override;
...@@ -114,6 +117,7 @@ struct QMetalSampler : public QRhiSampler ...@@ -114,6 +117,7 @@ struct QMetalSampler : public QRhiSampler
QMetalSampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode, QMetalSampler(QRhiImplementation *rhi, Filter magFilter, Filter minFilter, Filter mipmapMode,
AddressMode u, AddressMode v, AddressMode w); AddressMode u, AddressMode v, AddressMode w);
~QMetalSampler(); ~QMetalSampler();
bool isShareable() const override;
void release() override; void release() override;
bool build() override; bool build() override;
......
...@@ -91,6 +91,7 @@ public: ...@@ -91,6 +91,7 @@ public:
#ifdef Q_OS_DARWIN #ifdef Q_OS_DARWIN
struct { struct {
void *dev = nullptr; void *dev = nullptr;
void *releaseQueue = nullptr;
} d_metal; } d_metal;
#endif #endif
}; };
......
res.sh.: mtl event
res.sh.: example to show read/write same texture res.sh.: example to show read/write same texture
threading with rsh with resource - more external sync needed threading with rsh with resource - more external sync needed?
advanced blend modes advanced blend modes
gl: tex formats (texture, readback) gl: tex formats (texture, readback)
gl: srgb gl: srgb? (glEnable and co.)
should istexformatsupported should check srgb combinations should istexformatsupported should check srgb combinations
vk: image in wrong layout when beginFrame-endFrame without a pass in it vk: image in wrong layout when beginFrame-endFrame without a pass in it
cbuffer alignment rules - some things fail to translate (to hlsl e.g. with structs), which is fine but how to mitigate cbuffer alignment rules - some things fail to translate (to hlsl e.g. with structs), which is fine but how to mitigate
...@@ -48,6 +48,7 @@ dxc for d3d as an alternative to fxc? ...@@ -48,6 +48,7 @@ dxc for d3d as an alternative to fxc?
hlsl -> dxc -> spirv -> spirv-cross hmmm... hlsl -> dxc -> spirv -> spirv-cross hmmm...
+++ done +++ done
res.sh.: mtl
res.sh.: gl res.sh.: gl
res.sh.: exercise it in multiwindow_threaded too res.sh.: exercise it in multiwindow_threaded too
res.sh.: vk, d3d res.sh.: vk, d3d
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment