wined3d: Handle multisample_quality if type == MULTISAMPLE_NON_MASKABLE.

This commit is contained in:
Stefan Dösinger 2015-08-25 00:43:39 +02:00 committed by Alexandre Julliard
parent 599d92a268
commit b471b217b2
2 changed files with 14 additions and 8 deletions

View File

@ -4405,7 +4405,6 @@ HRESULT CDECL wined3d_check_device_multisample_type(const struct wined3d *wined3
if (quality_levels) if (quality_levels)
{ {
if (multisample_type == WINED3D_MULTISAMPLE_NON_MASKABLE) if (multisample_type == WINED3D_MULTISAMPLE_NON_MASKABLE)
/* FIXME: This is probably wrong. */
*quality_levels = gl_info->limits.samples; *quality_levels = gl_info->limits.samples;
else else
*quality_levels = 1; *quality_levels = 1;

View File

@ -2844,12 +2844,25 @@ void surface_prepare_rb(struct wined3d_surface *surface, const struct wined3d_gl
{ {
if (multisample) if (multisample)
{ {
DWORD samples;
if (surface->rb_multisample) if (surface->rb_multisample)
return; return;
/* TODO: Nvidia exposes their Coverage Sample Anti-Aliasing (CSAA) feature
* through type == MULTISAMPLE_XX and quality != 0. This could be mapped
* to GL_NV_framebuffer_multisample_coverage.
*
* AMD has a similar feature called Enhanced Quality Anti-Aliasing (EQAA),
* but it does not have an equivalent OpenGL extension. */
if (surface->resource.multisample_type == WINED3D_MULTISAMPLE_NON_MASKABLE)
samples = surface->resource.multisample_quality;
else
samples = surface->resource.multisample_type;
gl_info->fbo_ops.glGenRenderbuffers(1, &surface->rb_multisample); gl_info->fbo_ops.glGenRenderbuffers(1, &surface->rb_multisample);
gl_info->fbo_ops.glBindRenderbuffer(GL_RENDERBUFFER, surface->rb_multisample); gl_info->fbo_ops.glBindRenderbuffer(GL_RENDERBUFFER, surface->rb_multisample);
gl_info->fbo_ops.glRenderbufferStorageMultisample(GL_RENDERBUFFER, surface->resource.multisample_type, gl_info->fbo_ops.glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples,
surface->resource.format->glInternal, surface->pow2Width, surface->pow2Height); surface->resource.format->glInternal, surface->pow2Width, surface->pow2Height);
checkGLcall("glRenderbufferStorageMultisample()"); checkGLcall("glRenderbufferStorageMultisample()");
TRACE("Created multisample rb %u.\n", surface->rb_multisample); TRACE("Created multisample rb %u.\n", surface->rb_multisample);
@ -5395,12 +5408,6 @@ static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_text
unsigned int resource_size; unsigned int resource_size;
HRESULT hr; HRESULT hr;
if (multisample_quality > 0)
{
FIXME("multisample_quality set to %u, substituting 0.\n", multisample_quality);
multisample_quality = 0;
}
/* Quick lockable sanity check. /* Quick lockable sanity check.
* TODO: remove this after surfaces, usage and lockability have been debugged properly * TODO: remove this after surfaces, usage and lockability have been debugged properly
* this function is too deep to need to care about things like this. * this function is too deep to need to care about things like this.