tests: Wait to init targetView until needed
Not every image needs a color attachment view (textures for instance), and if you try to create a view for a optimal_tiled image on Nvidia, you get a segv in the driver, so wait to generate the view until you are sure you need it.
diff --git a/tests/xglrenderframework.h b/tests/xglrenderframework.h
index 10c1bee..96268c1 100644
--- a/tests/xglrenderframework.h
+++ b/tests/xglrenderframework.h
@@ -215,8 +215,21 @@
{
return obj();
}
- XGL_COLOR_ATTACHMENT_VIEW targetView()const
+ XGL_COLOR_ATTACHMENT_VIEW targetView()
{
+ if (!m_targetView.initialized())
+ {
+ XGL_COLOR_ATTACHMENT_VIEW_CREATE_INFO createView = {
+ XGL_STRUCTURE_TYPE_COLOR_ATTACHMENT_VIEW_CREATE_INFO,
+ XGL_NULL_HANDLE,
+ obj(),
+ XGL_FMT_B8G8R8A8_UNORM,
+ 0,
+ 0,
+ 1
+ };
+ m_targetView.init(*m_device, createView);
+ }
return m_targetView.obj();
}