Comments (10)
I believe I have a fix here: 6517a4d
It was simpler than my previous guess, so there's always the possibility that I'm missing something.
if (_isDepthStencilClear) {
_rpsKey.enable(kMVKAttachmentFormatDepthStencilIndex);
+ _rpsKey.attachmentMTLPixelFormats[kMVKAttachmentFormatDepthStencilIndex] =_image->getMTLPixelFormat();
from moltenvk.
Never mind, the above fixes one issue, but there seem to be at least one more in the vicinity. Without my patch above, calling vkCmdClearDepthStencilImage
actually gives this validation error:
-[MTLRenderPipelineDescriptorInternal validateWithDevice:]:2400: failed assertion `No valid pixelFormats set.'
Obviously, setting the attachments's pixel format fixes it.
There's some other issue which causes the problem in the issue title, but it seems related as it's in the same function.
from moltenvk.
I'm having the same issue:
-[MTLRenderPipelineDescriptorInternal validateWithDevice:]:2400: failed assertion `No valid pixelFormats set.'
With extended validation I get:
validateAttachmentOnDevice:248: failed assertion `PixelFormat MTLPixelFormatStencil8 is not color renderable'
Any luck on finding a solution?
from moltenvk.
I believe the No valid pixelFormats set
problem is fixed by #161.
The PixelFormat xyz is not color renderable
problem is still happening for me, even on master. Luckily, it's just a debugger validation error, and I don't notice any major rendering artifacts.
from moltenvk.
#161 fixes several issues we were having with stencil buffers. Thank you @mellinoe !
I wonder if this issue can be closed now?
from moltenvk.
I believe there's still a bug here somewhere, but unfortunately I haven't had time to debug through everything since a week ago.
When clearing a depth image, MoltenVK seems to use a synthetic render pass (with the appropriate clearing properties set). That synthetic render pass seems to have an issue where it attaches the depth image as a "color target", but with the format set to MTLPixelFormatDepth16Unorm
(or whatever other depth format is in use). That triggers the "PixelFormat xyz is not color renderable
" error mentioned above. Based on that, I don't think the problem should be too hard to fix, but it was taking me a while to debug through that process, and I gave up after #161 fixed all of my "critical" (aka app-crashing) problems.
There might be more to the issue, but the above is what I learned from my last debugging session.
from moltenvk.
Thanks for all your work on this. Is there anything left to work on here? Can we close this issue?
from moltenvk.
@billhollings The validation error I described above is still happening whenever my app is run under the Xcode debugger. Despite that, I don't see any rendering artifacts or experience any other crashes when running outside the debugger. Does the description I wrote above make any sense, particularly the part about the synthetic render pass used for image clearing operations?
from moltenvk.
Fixed in PR #181. Please retest and close.
Further clearing enhancements are under development and will be released soon...but the basic depth clearing should be working now...with no Metal validation errors.
from moltenvk.
Yes, after updating I am completely error-free. Thanks for the fix.
from moltenvk.
Related Issues (20)
- Possible regression in Khronos buffer_device_address sample in MoltenVK 1.2.8 HOT 5
- GPU address fault error when using descriptor indexing + variable descriptor count HOT 2
- Unnecessary 'Metal does not support disabling primitive restart' warnings HOT 8
- Support VK_EXT_rasterization_order_attachment_access
- EXC_BAD_ACCESS from mvkUpdateDescriptorSets on macOS HOT 13
- Latest MoltenVK instable on iOS and macOS HOT 7
- Uncaught selector, -[CAMetalDrawable addPresentedHandler:] (first introduced 1.2.6) HOT 20
- Possible regression in timeline semaphores on iOS in MoltenVK 1.2.10 HOT 3
- Was Vulkan SDK 1.3.290 released with MoltenVK 1.2.9? HOT 2
- Texture sharing between OpenGL and Vulkan on macOS
- Library not loaded: CoreSimulator when building MoltenVK in CI HOT 2
- Vulkan checkinfo broken in MoltenVK MacOS M1 HOT 5
- vkQueuePresentKHR often crashes HOT 2
- Bindless textures not always work with 1.2.10 on mac HOT 1
- Support more 32-bit floating-point pixel format caps on iOS HOT 1
- Enable blending cap for RGB9E5Float HOT 1
- `vkCmdSetScissor` behavior violates vulkan spec
- Swapchain images are incorrectly displayed in borderless fullscreen when using particular VkFormats
- vkQueueSubmit is leaking 13 GB of memory at every call when using an SSBO HOT 2
- DeviceAddressBuffer (encodeGPUAddressableBuffers) resource usage bug
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moltenvk.