On Mon, Jun 6, 2016 at 2:59 PM, Henri Verbeet <hverbeet(a)gmail.com> wrote:
On 6 June 2016 at 11:39, Józef Kucia <jkucia(a)codeweavers.com> wrote:
+static BOOL gl_internal_format_equal(const struct wined3d_format *format1, + const struct wined3d_format *format2) +{ + return format1->id == format2->id + || (format1->glInternal == format2->glInternal + && format1->glGammaInternal == format2->glGammaInternal + && format1->rtInternal == format2->rtInternal); +} When would you use this? I was under the impression that Direct3D views were a bit more restricted then OpenGL views and only work between formats based on the same typeless format.
It's mostly for the case when a view is created for a typeless format with depth/stencil internal format in wined3d. The other condition in gl_texture_view_compatible() rejects depth/stencil formats because OpenGL texture views cannot be created between RGB and depth/stencil formats. This condition is more permissive than it should be because I wanted to avoid "regressions". Previously, we allowed creating any shader view with no validation. I guess I could also introduce an additional GLenum field in wined3d_format for GL_VIEW_COMPATIBILITY_CLASS and make the condition in gl_texture_view_compatible() more explicit and clear, i.e. format1->gl_view_class == format2->gl_view_class && format1->typeless_id == format2->typeless_id.