Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/d3d8/tests/device.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index 9efa94329836..6ae17829b818 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -8492,9 +8492,64 @@ static void test_clip_planes_limits(void) DestroyWindow(window); }
+static void test_swapchain_multisample_reset(void) +{ + D3DPRESENT_PARAMETERS present_parameters; + IDirect3DDevice8 *device; + IDirect3D8 *d3d; + ULONG refcount; + HWND window; + HRESULT hr; + + window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + ok(!!window, "Failed to create a window.\n"); + d3d = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create D3D object.\n"); + + if (IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES) == D3DERR_NOTAVAILABLE) + { + skip("Multisampling not supported for D3DFMT_A8R8G8B8.\n"); + IDirect3D8_Release(d3d); + DestroyWindow(window); + return; + } + + if (!(device = create_device(d3d, window, NULL))) + { + skip("Failed to create 3D device.\n"); + IDirect3D8_Release(d3d); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 1.0f, 0); + ok(hr == D3D_OK, "Failed to clear, hr %#x.\n", hr); + + memset(&present_parameters, 0, sizeof(present_parameters)); + present_parameters.BackBufferWidth = 640; + present_parameters.BackBufferHeight = 480; + present_parameters.BackBufferFormat = D3DFMT_A8R8G8B8; + present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD; + present_parameters.hDeviceWindow = NULL; + present_parameters.Windowed = TRUE; + present_parameters.MultiSampleType = D3DMULTISAMPLE_2_SAMPLES; + hr = IDirect3DDevice8_Reset(device, &present_parameters); + ok(hr == D3D_OK, "Failed to reset device, hr %#x.\n", hr); + + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); + ok(hr == D3D_OK, "Failed to clear, hr %#x.\n", hr); + + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D8_Release(d3d); + DestroyWindow(window); +} + START_TEST(device) { - HMODULE d3d8_handle = GetModuleHandleA( "d3d8.dll" ); + HMODULE d3d8_handle = GetModuleHandleA("d3d8.dll"); WNDCLASSA wc = {0}; IDirect3D8 *d3d8; DEVMODEW current_mode; @@ -8600,6 +8655,7 @@ START_TEST(device) test_format_unknown(); test_destroyed_window(); test_clip_planes_limits(); + test_swapchain_multisample_reset();
UnregisterClassA("d3d8_test_wc", GetModuleHandleA(NULL)); }
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/wined3d/directx.c | 232 ++++++++++++++++++++++++------------------------- 1 file changed, 116 insertions(+), 116 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 0678ebf9de09..f7f6452fa953 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -3207,122 +3207,122 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info) USE_GL_FUNC(wglSwapIntervalEXT)
/* Newer core functions */ - USE_GL_FUNC(glActiveTexture) /* OpenGL 1.3 */ - USE_GL_FUNC(glAttachShader) /* OpenGL 2.0 */ - USE_GL_FUNC(glBeginQuery) /* OpenGL 1.5 */ - USE_GL_FUNC(glBeginTransformFeedback) /* OpenGL 3.0 */ - USE_GL_FUNC(glBindAttribLocation) /* OpenGL 2.0 */ - USE_GL_FUNC(glBindBuffer) /* OpenGL 1.5 */ - USE_GL_FUNC(glBindFragDataLocation) /* OpenGL 3.0 */ - USE_GL_FUNC(glBindVertexArray) /* OpenGL 3.0 */ - USE_GL_FUNC(glBlendColor) /* OpenGL 1.4 */ - USE_GL_FUNC(glBlendEquation) /* OpenGL 1.4 */ - USE_GL_FUNC(glBlendEquationSeparate) /* OpenGL 2.0 */ - USE_GL_FUNC(glBlendFuncSeparate) /* OpenGL 1.4 */ - USE_GL_FUNC(glBufferData) /* OpenGL 1.5 */ - USE_GL_FUNC(glBufferSubData) /* OpenGL 1.5 */ - USE_GL_FUNC(glColorMaski) /* OpenGL 3.0 */ - USE_GL_FUNC(glCompileShader) /* OpenGL 2.0 */ - USE_GL_FUNC(glCompressedTexImage2D) /* OpenGL 1.3 */ - USE_GL_FUNC(glCompressedTexImage3D) /* OpenGL 1.3 */ - USE_GL_FUNC(glCompressedTexSubImage2D) /* OpenGL 1.3 */ - USE_GL_FUNC(glCompressedTexSubImage3D) /* OpenGL 1.3 */ - USE_GL_FUNC(glCreateProgram) /* OpenGL 2.0 */ - USE_GL_FUNC(glCreateShader) /* OpenGL 2.0 */ - USE_GL_FUNC(glDebugMessageCallback) /* OpenGL 4.3 */ - USE_GL_FUNC(glDebugMessageControl) /* OpenGL 4.3 */ - USE_GL_FUNC(glDebugMessageInsert) /* OpenGL 4.3 */ - USE_GL_FUNC(glDeleteBuffers) /* OpenGL 1.5 */ - USE_GL_FUNC(glDeleteProgram) /* OpenGL 2.0 */ - USE_GL_FUNC(glDeleteQueries) /* OpenGL 1.5 */ - USE_GL_FUNC(glDeleteShader) /* OpenGL 2.0 */ - USE_GL_FUNC(glDeleteVertexArrays) /* OpenGL 3.0 */ - USE_GL_FUNC(glDetachShader) /* OpenGL 2.0 */ - USE_GL_FUNC(glDisablei) /* OpenGL 3.0 */ - USE_GL_FUNC(glDisableVertexAttribArray) /* OpenGL 2.0 */ - USE_GL_FUNC(glDrawArraysInstanced) /* OpenGL 3.1 */ - USE_GL_FUNC(glDrawBuffers) /* OpenGL 2.0 */ - USE_GL_FUNC(glDrawElementsInstanced) /* OpenGL 3.1 */ - USE_GL_FUNC(glEnablei) /* OpenGL 3.0 */ - USE_GL_FUNC(glEnableVertexAttribArray) /* OpenGL 2.0 */ - USE_GL_FUNC(glEndQuery) /* OpenGL 1.5 */ - USE_GL_FUNC(glEndTransformFeedback) /* OpenGL 3.0 */ - USE_GL_FUNC(glFramebufferTexture) /* OpenGL 3.2 */ - USE_GL_FUNC(glGenBuffers) /* OpenGL 1.5 */ - USE_GL_FUNC(glGenQueries) /* OpenGL 1.5 */ - USE_GL_FUNC(glGenVertexArrays) /* OpenGL 3.0 */ - USE_GL_FUNC(glGetActiveUniform) /* OpenGL 2.0 */ - USE_GL_FUNC(glGetAttachedShaders) /* OpenGL 2.0 */ - USE_GL_FUNC(glGetAttribLocation) /* OpenGL 2.0 */ - USE_GL_FUNC(glGetBooleani_v) /* OpenGL 3.0 */ - USE_GL_FUNC(glGetBufferSubData) /* OpenGL 1.5 */ - USE_GL_FUNC(glGetCompressedTexImage) /* OpenGL 1.3 */ - USE_GL_FUNC(glGetDebugMessageLog) /* OpenGL 4.3 */ - USE_GL_FUNC(glGetIntegeri_v) /* OpenGL 3.0 */ - USE_GL_FUNC(glGetProgramInfoLog) /* OpenGL 2.0 */ - USE_GL_FUNC(glGetProgramiv) /* OpenGL 2.0 */ - USE_GL_FUNC(glGetQueryiv) /* OpenGL 1.5 */ - USE_GL_FUNC(glGetQueryObjectuiv) /* OpenGL 1.5 */ - USE_GL_FUNC(glGetShaderInfoLog) /* OpenGL 2.0 */ - USE_GL_FUNC(glGetShaderiv) /* OpenGL 2.0 */ - USE_GL_FUNC(glGetShaderSource) /* OpenGL 2.0 */ - USE_GL_FUNC(glGetStringi) /* OpenGL 3.0 */ - USE_GL_FUNC(glGetTextureLevelParameteriv) /* OpenGL 4.5 */ - USE_GL_FUNC(glGetTextureParameteriv) /* OpenGL 4.5 */ - USE_GL_FUNC(glGetUniformfv) /* OpenGL 2.0 */ - USE_GL_FUNC(glGetUniformiv) /* OpenGL 2.0 */ - USE_GL_FUNC(glGetUniformLocation) /* OpenGL 2.0 */ - USE_GL_FUNC(glIsEnabledi) /* OpenGL 3.0 */ - USE_GL_FUNC(glLinkProgram) /* OpenGL 2.0 */ - USE_GL_FUNC(glMapBuffer) /* OpenGL 1.5 */ - USE_GL_FUNC(glPointParameteri) /* OpenGL 1.4 */ - USE_GL_FUNC(glPointParameteriv) /* OpenGL 1.4 */ - USE_GL_FUNC(glShaderSource) /* OpenGL 2.0 */ - USE_GL_FUNC(glStencilFuncSeparate) /* OpenGL 2.0 */ - USE_GL_FUNC(glStencilOpSeparate) /* OpenGL 2.0 */ - USE_GL_FUNC(glTexBuffer) /* OpenGL 3.1 */ - USE_GL_FUNC(glTexImage3D) /* OpenGL 1.2 */ - USE_GL_FUNC(glTexSubImage3D) /* OpenGL 1.2 */ - USE_GL_FUNC(glTransformFeedbackVaryings)/* OpenGL 3.0 */ - USE_GL_FUNC(glUniform1f) /* OpenGL 2.0 */ - USE_GL_FUNC(glUniform1fv) /* OpenGL 2.0 */ - USE_GL_FUNC(glUniform1i) /* OpenGL 2.0 */ - USE_GL_FUNC(glUniform1iv) /* OpenGL 2.0 */ - USE_GL_FUNC(glUniform2f) /* OpenGL 2.0 */ - USE_GL_FUNC(glUniform2fv) /* OpenGL 2.0 */ - USE_GL_FUNC(glUniform2i) /* OpenGL 2.0 */ - USE_GL_FUNC(glUniform2iv) /* OpenGL 2.0 */ - USE_GL_FUNC(glUniform3f) /* OpenGL 2.0 */ - USE_GL_FUNC(glUniform3fv) /* OpenGL 2.0 */ - USE_GL_FUNC(glUniform3i) /* OpenGL 2.0 */ - USE_GL_FUNC(glUniform3iv) /* OpenGL 2.0 */ - USE_GL_FUNC(glUniform4f) /* OpenGL 2.0 */ - USE_GL_FUNC(glUniform4fv) /* OpenGL 2.0 */ - USE_GL_FUNC(glUniform4i) /* OpenGL 2.0 */ - USE_GL_FUNC(glUniform4iv) /* OpenGL 2.0 */ - USE_GL_FUNC(glUniformMatrix2fv) /* OpenGL 2.0 */ - USE_GL_FUNC(glUniformMatrix3fv) /* OpenGL 2.0 */ - USE_GL_FUNC(glUniformMatrix4fv) /* OpenGL 2.0 */ - USE_GL_FUNC(glUnmapBuffer) /* OpenGL 1.5 */ - USE_GL_FUNC(glUseProgram) /* OpenGL 2.0 */ - USE_GL_FUNC(glValidateProgram) /* OpenGL 2.0 */ - USE_GL_FUNC(glVertexAttrib1f) /* OpenGL 2.0 */ - USE_GL_FUNC(glVertexAttrib1fv) /* OpenGL 2.0 */ - USE_GL_FUNC(glVertexAttrib2f) /* OpenGL 2.0 */ - USE_GL_FUNC(glVertexAttrib2fv) /* OpenGL 2.0 */ - USE_GL_FUNC(glVertexAttrib3f) /* OpenGL 2.0 */ - USE_GL_FUNC(glVertexAttrib3fv) /* OpenGL 2.0 */ - USE_GL_FUNC(glVertexAttrib4f) /* OpenGL 2.0 */ - USE_GL_FUNC(glVertexAttrib4fv) /* OpenGL 2.0 */ - USE_GL_FUNC(glVertexAttrib4Nsv) /* OpenGL 2.0 */ - USE_GL_FUNC(glVertexAttrib4Nub) /* OpenGL 2.0 */ - USE_GL_FUNC(glVertexAttrib4Nubv) /* OpenGL 2.0 */ - USE_GL_FUNC(glVertexAttrib4Nusv) /* OpenGL 2.0 */ - USE_GL_FUNC(glVertexAttrib4sv) /* OpenGL 2.0 */ - USE_GL_FUNC(glVertexAttrib4ubv) /* OpenGL 2.0 */ - USE_GL_FUNC(glVertexAttribDivisor) /* OpenGL 3.3 */ - USE_GL_FUNC(glVertexAttribIPointer) /* OpenGL 3.0 */ - USE_GL_FUNC(glVertexAttribPointer) /* OpenGL 2.0 */ + USE_GL_FUNC(glActiveTexture) /* OpenGL 1.3 */ + USE_GL_FUNC(glAttachShader) /* OpenGL 2.0 */ + USE_GL_FUNC(glBeginQuery) /* OpenGL 1.5 */ + USE_GL_FUNC(glBeginTransformFeedback) /* OpenGL 3.0 */ + USE_GL_FUNC(glBindAttribLocation) /* OpenGL 2.0 */ + USE_GL_FUNC(glBindBuffer) /* OpenGL 1.5 */ + USE_GL_FUNC(glBindFragDataLocation) /* OpenGL 3.0 */ + USE_GL_FUNC(glBindVertexArray) /* OpenGL 3.0 */ + USE_GL_FUNC(glBlendColor) /* OpenGL 1.4 */ + USE_GL_FUNC(glBlendEquation) /* OpenGL 1.4 */ + USE_GL_FUNC(glBlendEquationSeparate) /* OpenGL 2.0 */ + USE_GL_FUNC(glBlendFuncSeparate) /* OpenGL 1.4 */ + USE_GL_FUNC(glBufferData) /* OpenGL 1.5 */ + USE_GL_FUNC(glBufferSubData) /* OpenGL 1.5 */ + USE_GL_FUNC(glColorMaski) /* OpenGL 3.0 */ + USE_GL_FUNC(glCompileShader) /* OpenGL 2.0 */ + USE_GL_FUNC(glCompressedTexImage2D) /* OpenGL 1.3 */ + USE_GL_FUNC(glCompressedTexImage3D) /* OpenGL 1.3 */ + USE_GL_FUNC(glCompressedTexSubImage2D) /* OpenGL 1.3 */ + USE_GL_FUNC(glCompressedTexSubImage3D) /* OpenGL 1.3 */ + USE_GL_FUNC(glCreateProgram) /* OpenGL 2.0 */ + USE_GL_FUNC(glCreateShader) /* OpenGL 2.0 */ + USE_GL_FUNC(glDebugMessageCallback) /* OpenGL 4.3 */ + USE_GL_FUNC(glDebugMessageControl) /* OpenGL 4.3 */ + USE_GL_FUNC(glDebugMessageInsert) /* OpenGL 4.3 */ + USE_GL_FUNC(glDeleteBuffers) /* OpenGL 1.5 */ + USE_GL_FUNC(glDeleteProgram) /* OpenGL 2.0 */ + USE_GL_FUNC(glDeleteQueries) /* OpenGL 1.5 */ + USE_GL_FUNC(glDeleteShader) /* OpenGL 2.0 */ + USE_GL_FUNC(glDeleteVertexArrays) /* OpenGL 3.0 */ + USE_GL_FUNC(glDetachShader) /* OpenGL 2.0 */ + USE_GL_FUNC(glDisablei) /* OpenGL 3.0 */ + USE_GL_FUNC(glDisableVertexAttribArray) /* OpenGL 2.0 */ + USE_GL_FUNC(glDrawArraysInstanced) /* OpenGL 3.1 */ + USE_GL_FUNC(glDrawBuffers) /* OpenGL 2.0 */ + USE_GL_FUNC(glDrawElementsInstanced) /* OpenGL 3.1 */ + USE_GL_FUNC(glEnablei) /* OpenGL 3.0 */ + USE_GL_FUNC(glEnableVertexAttribArray) /* OpenGL 2.0 */ + USE_GL_FUNC(glEndQuery) /* OpenGL 1.5 */ + USE_GL_FUNC(glEndTransformFeedback) /* OpenGL 3.0 */ + USE_GL_FUNC(glFramebufferTexture) /* OpenGL 3.2 */ + USE_GL_FUNC(glGenBuffers) /* OpenGL 1.5 */ + USE_GL_FUNC(glGenQueries) /* OpenGL 1.5 */ + USE_GL_FUNC(glGenVertexArrays) /* OpenGL 3.0 */ + USE_GL_FUNC(glGetActiveUniform) /* OpenGL 2.0 */ + USE_GL_FUNC(glGetAttachedShaders) /* OpenGL 2.0 */ + USE_GL_FUNC(glGetAttribLocation) /* OpenGL 2.0 */ + USE_GL_FUNC(glGetBooleani_v) /* OpenGL 3.0 */ + USE_GL_FUNC(glGetBufferSubData) /* OpenGL 1.5 */ + USE_GL_FUNC(glGetCompressedTexImage) /* OpenGL 1.3 */ + USE_GL_FUNC(glGetDebugMessageLog) /* OpenGL 4.3 */ + USE_GL_FUNC(glGetIntegeri_v) /* OpenGL 3.0 */ + USE_GL_FUNC(glGetProgramInfoLog) /* OpenGL 2.0 */ + USE_GL_FUNC(glGetProgramiv) /* OpenGL 2.0 */ + USE_GL_FUNC(glGetQueryiv) /* OpenGL 1.5 */ + USE_GL_FUNC(glGetQueryObjectuiv) /* OpenGL 1.5 */ + USE_GL_FUNC(glGetShaderInfoLog) /* OpenGL 2.0 */ + USE_GL_FUNC(glGetShaderiv) /* OpenGL 2.0 */ + USE_GL_FUNC(glGetShaderSource) /* OpenGL 2.0 */ + USE_GL_FUNC(glGetStringi) /* OpenGL 3.0 */ + USE_GL_FUNC(glGetTextureLevelParameteriv) /* OpenGL 4.5 */ + USE_GL_FUNC(glGetTextureParameteriv) /* OpenGL 4.5 */ + USE_GL_FUNC(glGetUniformfv) /* OpenGL 2.0 */ + USE_GL_FUNC(glGetUniformiv) /* OpenGL 2.0 */ + USE_GL_FUNC(glGetUniformLocation) /* OpenGL 2.0 */ + USE_GL_FUNC(glIsEnabledi) /* OpenGL 3.0 */ + USE_GL_FUNC(glLinkProgram) /* OpenGL 2.0 */ + USE_GL_FUNC(glMapBuffer) /* OpenGL 1.5 */ + USE_GL_FUNC(glPointParameteri) /* OpenGL 1.4 */ + USE_GL_FUNC(glPointParameteriv) /* OpenGL 1.4 */ + USE_GL_FUNC(glShaderSource) /* OpenGL 2.0 */ + USE_GL_FUNC(glStencilFuncSeparate) /* OpenGL 2.0 */ + USE_GL_FUNC(glStencilOpSeparate) /* OpenGL 2.0 */ + USE_GL_FUNC(glTexBuffer) /* OpenGL 3.1 */ + USE_GL_FUNC(glTexImage3D) /* OpenGL 1.2 */ + USE_GL_FUNC(glTexSubImage3D) /* OpenGL 1.2 */ + USE_GL_FUNC(glTransformFeedbackVaryings) /* OpenGL 3.0 */ + USE_GL_FUNC(glUniform1f) /* OpenGL 2.0 */ + USE_GL_FUNC(glUniform1fv) /* OpenGL 2.0 */ + USE_GL_FUNC(glUniform1i) /* OpenGL 2.0 */ + USE_GL_FUNC(glUniform1iv) /* OpenGL 2.0 */ + USE_GL_FUNC(glUniform2f) /* OpenGL 2.0 */ + USE_GL_FUNC(glUniform2fv) /* OpenGL 2.0 */ + USE_GL_FUNC(glUniform2i) /* OpenGL 2.0 */ + USE_GL_FUNC(glUniform2iv) /* OpenGL 2.0 */ + USE_GL_FUNC(glUniform3f) /* OpenGL 2.0 */ + USE_GL_FUNC(glUniform3fv) /* OpenGL 2.0 */ + USE_GL_FUNC(glUniform3i) /* OpenGL 2.0 */ + USE_GL_FUNC(glUniform3iv) /* OpenGL 2.0 */ + USE_GL_FUNC(glUniform4f) /* OpenGL 2.0 */ + USE_GL_FUNC(glUniform4fv) /* OpenGL 2.0 */ + USE_GL_FUNC(glUniform4i) /* OpenGL 2.0 */ + USE_GL_FUNC(glUniform4iv) /* OpenGL 2.0 */ + USE_GL_FUNC(glUniformMatrix2fv) /* OpenGL 2.0 */ + USE_GL_FUNC(glUniformMatrix3fv) /* OpenGL 2.0 */ + USE_GL_FUNC(glUniformMatrix4fv) /* OpenGL 2.0 */ + USE_GL_FUNC(glUnmapBuffer) /* OpenGL 1.5 */ + USE_GL_FUNC(glUseProgram) /* OpenGL 2.0 */ + USE_GL_FUNC(glValidateProgram) /* OpenGL 2.0 */ + USE_GL_FUNC(glVertexAttrib1f) /* OpenGL 2.0 */ + USE_GL_FUNC(glVertexAttrib1fv) /* OpenGL 2.0 */ + USE_GL_FUNC(glVertexAttrib2f) /* OpenGL 2.0 */ + USE_GL_FUNC(glVertexAttrib2fv) /* OpenGL 2.0 */ + USE_GL_FUNC(glVertexAttrib3f) /* OpenGL 2.0 */ + USE_GL_FUNC(glVertexAttrib3fv) /* OpenGL 2.0 */ + USE_GL_FUNC(glVertexAttrib4f) /* OpenGL 2.0 */ + USE_GL_FUNC(glVertexAttrib4fv) /* OpenGL 2.0 */ + USE_GL_FUNC(glVertexAttrib4Nsv) /* OpenGL 2.0 */ + USE_GL_FUNC(glVertexAttrib4Nub) /* OpenGL 2.0 */ + USE_GL_FUNC(glVertexAttrib4Nubv) /* OpenGL 2.0 */ + USE_GL_FUNC(glVertexAttrib4Nusv) /* OpenGL 2.0 */ + USE_GL_FUNC(glVertexAttrib4sv) /* OpenGL 2.0 */ + USE_GL_FUNC(glVertexAttrib4ubv) /* OpenGL 2.0 */ + USE_GL_FUNC(glVertexAttribDivisor) /* OpenGL 3.3 */ + USE_GL_FUNC(glVertexAttribIPointer) /* OpenGL 3.0 */ + USE_GL_FUNC(glVertexAttribPointer) /* OpenGL 2.0 */ #undef USE_GL_FUNC
#ifndef USE_WIN32_OPENGL
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/wined3d/context.c | 17 ++++++++++++++++- dlls/wined3d/device.c | 31 +++++++++++++++++++++++++++++++ dlls/wined3d/wined3d_private.h | 2 ++ 3 files changed, 49 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 8c2ea866113d..7eeb8c41938f 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -1756,7 +1756,15 @@ void context_bind_dummy_textures(const struct wined3d_device *device, const stru if (gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT]) gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_BUFFER, device->dummy_textures.tex_buffer);
- checkGLcall("Bind dummy textures"); + if (gl_info->supported[ARB_TEXTURE_MULTISAMPLE]) + { + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, + device->dummy_textures.tex_2d_ms); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, + device->dummy_textures.tex_2d_ms_array); + } + + checkGLcall("bind dummy textures"); } }
@@ -2759,6 +2767,13 @@ void context_bind_texture(struct wined3d_context *context, GLenum target, GLuint gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_BUFFER, device->dummy_textures.tex_buffer); checkGLcall("glBindTexture"); break; + case GL_TEXTURE_2D_MULTISAMPLE: + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, device->dummy_textures.tex_2d_ms); + break; + case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, + device->dummy_textures.tex_2d_ms_array); + break; default: ERR("Unexpected texture target %#x.\n", old_texture_type); } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index e41227256de8..be77c0e5bb81 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -727,6 +727,31 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_ checkGLcall("glDeleteBuffers"); }
+ if (gl_info->supported[ARB_TEXTURE_MULTISAMPLE]) + { + gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_textures.tex_2d_ms); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, device->dummy_textures.tex_2d_ms); + GL_EXTCALL(glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, 1, GL_RGBA8, 1, 1, GL_TRUE)); + + gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_textures.tex_2d_ms_array); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, device->dummy_textures.tex_2d_ms_array); + GL_EXTCALL(glTexImage3DMultisample(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, 1, GL_RGBA8, 1, 1, 1, GL_TRUE)); + + if (gl_info->supported[ARB_CLEAR_TEXTURE]) + { + GL_EXTCALL(glClearTexImage(device->dummy_textures.tex_2d_ms, + 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &color)); + GL_EXTCALL(glClearTexImage(device->dummy_textures.tex_2d_ms_array, + 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &color)); + } + else + { + WARN("ARB_clear_texture is currently required to clear dummy multisample textures.\n"); + } + + checkGLcall("create dummy multisample textures"); + } + context_bind_dummy_textures(device, context); }
@@ -735,6 +760,12 @@ static void destroy_dummy_textures(struct wined3d_device *device, struct wined3d { const struct wined3d_gl_info *gl_info = context->gl_info;
+ if (gl_info->supported[ARB_TEXTURE_MULTISAMPLE]) + { + gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_2d_ms); + gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_2d_ms_array); + } + if (gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT]) gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_buffer);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 02f471b9c446..7cf5fc3fbfa5 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2942,6 +2942,8 @@ struct wined3d_device GLuint tex_cube_array; GLuint tex_2d_array; GLuint tex_buffer; + GLuint tex_2d_ms; + GLuint tex_2d_ms_array; } dummy_textures;
/* Default sampler used to emulate the direct resource access without using wined3d_sampler */
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/wined3d/context.c | 58 ++++++++----------- dlls/wined3d/device.c | 123 +++++++++++++++-------------------------- dlls/wined3d/wined3d_private.h | 26 +++++---- 3 files changed, 82 insertions(+), 125 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 7eeb8c41938f..b97dff500518 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -1728,44 +1728,42 @@ static int context_choose_pixel_format(const struct wined3d_device *device, HDC /* Context activation is done by the caller. */ void context_bind_dummy_textures(const struct wined3d_device *device, const struct wined3d_context *context) { + const struct wined3d_dummy_textures *textures = &context->device->dummy_textures; const struct wined3d_gl_info *gl_info = context->gl_info; unsigned int i;
for (i = 0; i < gl_info->limits.combined_samplers; ++i) { GL_EXTCALL(glActiveTexture(GL_TEXTURE0 + i)); - checkGLcall("glActiveTexture");
- gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, device->dummy_textures.tex_2d); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, textures->tex_2d);
if (gl_info->supported[ARB_TEXTURE_RECTANGLE]) - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_RECTANGLE_ARB, device->dummy_textures.tex_rect); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_RECTANGLE_ARB, textures->tex_rect);
if (gl_info->supported[EXT_TEXTURE3D]) - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_3D, device->dummy_textures.tex_3d); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_3D, textures->tex_3d);
if (gl_info->supported[ARB_TEXTURE_CUBE_MAP]) - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP, device->dummy_textures.tex_cube); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP, textures->tex_cube);
if (gl_info->supported[ARB_TEXTURE_CUBE_MAP_ARRAY]) - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY, device->dummy_textures.tex_cube_array); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY, textures->tex_cube_array);
if (gl_info->supported[EXT_TEXTURE_ARRAY]) - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_ARRAY, device->dummy_textures.tex_2d_array); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_ARRAY, textures->tex_2d_array);
if (gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT]) - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_BUFFER, device->dummy_textures.tex_buffer); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_BUFFER, textures->tex_buffer);
if (gl_info->supported[ARB_TEXTURE_MULTISAMPLE]) { - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, - device->dummy_textures.tex_2d_ms); - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, - device->dummy_textures.tex_2d_ms_array); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, textures->tex_2d_ms); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, textures->tex_2d_ms_array); } - - checkGLcall("bind dummy textures"); } + + checkGLcall("bind dummy textures"); }
void wined3d_check_gl_call(const struct wined3d_gl_info *gl_info, @@ -2716,6 +2714,7 @@ void context_bind_bo(struct wined3d_context *context, GLenum binding, GLuint nam
void context_bind_texture(struct wined3d_context *context, GLenum target, GLuint name) { + const struct wined3d_dummy_textures *textures = &context->device->dummy_textures; const struct wined3d_gl_info *gl_info = context->gl_info; DWORD unit = context->active_texture; DWORD old_texture_type = context->texture_type[unit]; @@ -2723,7 +2722,6 @@ void context_bind_texture(struct wined3d_context *context, GLenum target, GLuint if (name) { gl_info->gl_ops.gl.p_glBindTexture(target, name); - checkGLcall("glBindTexture"); } else { @@ -2732,47 +2730,37 @@ void context_bind_texture(struct wined3d_context *context, GLenum target, GLuint
if (old_texture_type != target) { - const struct wined3d_device *device = context->device; - switch (old_texture_type) { case GL_NONE: /* nothing to do */ break; case GL_TEXTURE_2D: - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, device->dummy_textures.tex_2d); - checkGLcall("glBindTexture"); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, textures->tex_2d); break; case GL_TEXTURE_2D_ARRAY: - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_ARRAY, device->dummy_textures.tex_2d_array); - checkGLcall("glBindTexture"); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_ARRAY, textures->tex_2d_array); break; case GL_TEXTURE_RECTANGLE_ARB: - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_RECTANGLE_ARB, device->dummy_textures.tex_rect); - checkGLcall("glBindTexture"); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_RECTANGLE_ARB, textures->tex_rect); break; case GL_TEXTURE_CUBE_MAP: - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP, device->dummy_textures.tex_cube); - checkGLcall("glBindTexture"); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP, textures->tex_cube); break; case GL_TEXTURE_CUBE_MAP_ARRAY: - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY, device->dummy_textures.tex_cube_array); - checkGLcall("glBindTexture"); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY, textures->tex_cube_array); break; case GL_TEXTURE_3D: - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_3D, device->dummy_textures.tex_3d); - checkGLcall("glBindTexture"); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_3D, textures->tex_3d); break; case GL_TEXTURE_BUFFER: - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_BUFFER, device->dummy_textures.tex_buffer); - checkGLcall("glBindTexture"); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_BUFFER, textures->tex_buffer); break; case GL_TEXTURE_2D_MULTISAMPLE: - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, device->dummy_textures.tex_2d_ms); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, textures->tex_2d_ms); break; case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, - device->dummy_textures.tex_2d_ms_array); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, textures->tex_2d_ms_array); break; default: ERR("Unexpected texture target %#x.\n", old_texture_type); @@ -2780,6 +2768,8 @@ void context_bind_texture(struct wined3d_context *context, GLenum target, GLuint
context->texture_type[unit] = target; } + + checkGLcall("bind texture"); }
void *context_map_bo_address(struct wined3d_context *context, diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index be77c0e5bb81..b8e7bfd94705 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -602,6 +602,7 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_ { const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; + struct wined3d_dummy_textures *textures = &device->dummy_textures; unsigned int i; DWORD color;
@@ -616,59 +617,39 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_ * to each texture stage when the currently set D3D texture is NULL. */ context_active_texture(context, gl_info, 0);
- gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_textures.tex_2d); - checkGLcall("glGenTextures"); - TRACE("Dummy 2D texture given name %u.\n", device->dummy_textures.tex_2d); - - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, device->dummy_textures.tex_2d); - checkGLcall("glBindTexture"); - + gl_info->gl_ops.gl.p_glGenTextures(1, &textures->tex_2d); + TRACE("Dummy 2D texture given name %u.\n", textures->tex_2d); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, textures->tex_2d); gl_info->gl_ops.gl.p_glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 1, 1, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &color); - checkGLcall("glTexImage2D");
if (gl_info->supported[ARB_TEXTURE_RECTANGLE]) { - gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_textures.tex_rect); - checkGLcall("glGenTextures"); - TRACE("Dummy rectangle texture given name %u.\n", device->dummy_textures.tex_rect); - - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_RECTANGLE_ARB, device->dummy_textures.tex_rect); - checkGLcall("glBindTexture"); - + gl_info->gl_ops.gl.p_glGenTextures(1, &textures->tex_rect); + TRACE("Dummy rectangle texture given name %u.\n", textures->tex_rect); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_RECTANGLE_ARB, textures->tex_rect); gl_info->gl_ops.gl.p_glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA8, 1, 1, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &color); - checkGLcall("glTexImage2D"); }
if (gl_info->supported[EXT_TEXTURE3D]) { - gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_textures.tex_3d); - checkGLcall("glGenTextures"); - TRACE("Dummy 3D texture given name %u.\n", device->dummy_textures.tex_3d); - - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_3D, device->dummy_textures.tex_3d); - checkGLcall("glBindTexture"); - + gl_info->gl_ops.gl.p_glGenTextures(1, &textures->tex_3d); + TRACE("Dummy 3D texture given name %u.\n", textures->tex_3d); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_3D, textures->tex_3d); GL_EXTCALL(glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA8, 1, 1, 1, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &color)); - checkGLcall("glTexImage3D"); }
if (gl_info->supported[ARB_TEXTURE_CUBE_MAP]) { - gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_textures.tex_cube); - checkGLcall("glGenTextures"); - TRACE("Dummy cube texture given name %u.\n", device->dummy_textures.tex_cube); - - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP, device->dummy_textures.tex_cube); - checkGLcall("glBindTexture"); - + gl_info->gl_ops.gl.p_glGenTextures(1, &textures->tex_cube); + TRACE("Dummy cube texture given name %u.\n", textures->tex_cube); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP, textures->tex_cube); for (i = GL_TEXTURE_CUBE_MAP_POSITIVE_X; i <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z; ++i) { gl_info->gl_ops.gl.p_glTexImage2D(i, 0, GL_RGBA8, 1, 1, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &color); - checkGLcall("glTexImage2D"); } }
@@ -676,32 +657,22 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_ { DWORD cube_array_data[6];
- gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_textures.tex_cube_array); - checkGLcall("glGenTextures"); - TRACE("Dummy cube array texture given name %u.\n", device->dummy_textures.tex_cube_array); - - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY, device->dummy_textures.tex_cube_array); - checkGLcall("glBindTexture"); - + gl_info->gl_ops.gl.p_glGenTextures(1, &textures->tex_cube_array); + TRACE("Dummy cube array texture given name %u.\n", textures->tex_cube_array); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY, textures->tex_cube_array); for (i = 0; i < ARRAY_SIZE(cube_array_data); ++i) cube_array_data[i] = color; GL_EXTCALL(glTexImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, 0, GL_RGBA8, 1, 1, 6, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, cube_array_data)); - checkGLcall("glTexImage3D"); }
if (gl_info->supported[EXT_TEXTURE_ARRAY]) { - gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_textures.tex_2d_array); - checkGLcall("glGenTextures"); - TRACE("Dummy 2D array texture given name %u.\n", device->dummy_textures.tex_2d_array); - - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_ARRAY, device->dummy_textures.tex_2d_array); - checkGLcall("glBindTexture"); - + gl_info->gl_ops.gl.p_glGenTextures(1, &textures->tex_2d_array); + TRACE("Dummy 2D array texture given name %u.\n", textures->tex_2d_array); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_ARRAY, textures->tex_2d_array); GL_EXTCALL(glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_RGBA8, 1, 1, 1, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &color)); - checkGLcall("glTexImage3D"); }
if (gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT]) @@ -712,83 +683,77 @@ static void create_dummy_textures(struct wined3d_device *device, struct wined3d_ GL_EXTCALL(glBindBuffer(GL_TEXTURE_BUFFER, buffer)); GL_EXTCALL(glBufferData(GL_TEXTURE_BUFFER, sizeof(color), &color, GL_STATIC_DRAW)); GL_EXTCALL(glBindBuffer(GL_TEXTURE_BUFFER, 0)); - checkGLcall("Create buffer object");
- gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_textures.tex_buffer); - checkGLcall("glGenTextures"); - TRACE("Dummy buffer texture given name %u.\n", device->dummy_textures.tex_buffer); - - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_BUFFER, device->dummy_textures.tex_buffer); - checkGLcall("glBindTexture"); + gl_info->gl_ops.gl.p_glGenTextures(1, &textures->tex_buffer); + TRACE("Dummy buffer texture given name %u.\n", textures->tex_buffer); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_BUFFER, textures->tex_buffer); GL_EXTCALL(glTexBuffer(GL_TEXTURE_BUFFER, GL_RGBA8, buffer)); - checkGLcall("glTexBuffer"); - GL_EXTCALL(glDeleteBuffers(1, &buffer)); - checkGLcall("glDeleteBuffers"); }
if (gl_info->supported[ARB_TEXTURE_MULTISAMPLE]) { - gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_textures.tex_2d_ms); - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, device->dummy_textures.tex_2d_ms); + gl_info->gl_ops.gl.p_glGenTextures(1, &textures->tex_2d_ms); + TRACE("Dummy multisample texture given name %u.\n", textures->tex_2d_ms); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, textures->tex_2d_ms); GL_EXTCALL(glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, 1, GL_RGBA8, 1, 1, GL_TRUE));
- gl_info->gl_ops.gl.p_glGenTextures(1, &device->dummy_textures.tex_2d_ms_array); - gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, device->dummy_textures.tex_2d_ms_array); + gl_info->gl_ops.gl.p_glGenTextures(1, &textures->tex_2d_ms_array); + TRACE("Dummy multisample array texture given name %u.\n", textures->tex_2d_ms_array); + gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, textures->tex_2d_ms_array); GL_EXTCALL(glTexImage3DMultisample(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, 1, GL_RGBA8, 1, 1, 1, GL_TRUE));
if (gl_info->supported[ARB_CLEAR_TEXTURE]) { - GL_EXTCALL(glClearTexImage(device->dummy_textures.tex_2d_ms, - 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &color)); - GL_EXTCALL(glClearTexImage(device->dummy_textures.tex_2d_ms_array, - 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &color)); + GL_EXTCALL(glClearTexImage(textures->tex_2d_ms, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &color)); + GL_EXTCALL(glClearTexImage(textures->tex_2d_ms_array, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, &color)); } else { WARN("ARB_clear_texture is currently required to clear dummy multisample textures.\n"); } - - checkGLcall("create dummy multisample textures"); }
+ checkGLcall("create dummy textures"); + context_bind_dummy_textures(device, context); }
/* Context activation is done by the caller. */ static void destroy_dummy_textures(struct wined3d_device *device, struct wined3d_context *context) { + struct wined3d_dummy_textures *dummy_textures = &device->dummy_textures; const struct wined3d_gl_info *gl_info = context->gl_info;
if (gl_info->supported[ARB_TEXTURE_MULTISAMPLE]) { - gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_2d_ms); - gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_2d_ms_array); + gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_2d_ms); + gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_2d_ms_array); }
if (gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT]) - gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_buffer); + gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_buffer);
if (gl_info->supported[EXT_TEXTURE_ARRAY]) - gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_2d_array); + gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_2d_array);
if (gl_info->supported[ARB_TEXTURE_CUBE_MAP_ARRAY]) - gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_cube_array); + gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_cube_array);
if (gl_info->supported[ARB_TEXTURE_CUBE_MAP]) - gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_cube); + gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_cube);
if (gl_info->supported[EXT_TEXTURE3D]) - gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_3d); + gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_3d);
if (gl_info->supported[ARB_TEXTURE_RECTANGLE]) - gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_rect); + gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_rect);
- gl_info->gl_ops.gl.p_glDeleteTextures(1, &device->dummy_textures.tex_2d); + gl_info->gl_ops.gl.p_glDeleteTextures(1, &dummy_textures->tex_2d);
- checkGLcall("Delete dummy textures"); + checkGLcall("delete dummy textures");
- memset(&device->dummy_textures, 0, sizeof(device->dummy_textures)); + memset(dummy_textures, 0, sizeof(*dummy_textures)); }
/* Context activation is done by the caller. */ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 7cf5fc3fbfa5..7a606a7a42da 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2860,6 +2860,19 @@ struct wined3d_state struct wined3d_rasterizer_state *rasterizer_state; };
+struct wined3d_dummy_textures +{ + GLuint tex_2d; + GLuint tex_rect; + GLuint tex_3d; + GLuint tex_cube; + GLuint tex_cube_array; + GLuint tex_2d_array; + GLuint tex_buffer; + GLuint tex_2d_ms; + GLuint tex_2d_ms_array; +}; + #define WINED3D_UNMAPPED_STAGE ~0u
/* Multithreaded flag. Removed from the public header to signal that @@ -2933,18 +2946,7 @@ struct wined3d_device struct wined3d_texture *logo_texture;
/* Textures for when no other textures are mapped */ - struct - { - GLuint tex_2d; - GLuint tex_rect; - GLuint tex_3d; - GLuint tex_cube; - GLuint tex_cube_array; - GLuint tex_2d_array; - GLuint tex_buffer; - GLuint tex_2d_ms; - GLuint tex_2d_ms_array; - } dummy_textures; + struct wined3d_dummy_textures dummy_textures;
/* Default sampler used to emulate the direct resource access without using wined3d_sampler */ struct wined3d_sampler *default_sampler;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/d3d10core/tests/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index 66591b210524..103b6705e342 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -1936,7 +1936,7 @@ static void test_create_depthstencil_view(void) }; #undef FMT_UNKNOWN #undef D24S8 -#undef R24S8_TL +#undef R24G8_TL #undef DIM_UNKNOWN #undef TEX_1D #undef TEX_1D_ARRAY
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/d3d11/tests/d3d11.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index e0769a75a11e..6267eaf99154 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -2870,7 +2870,7 @@ static void test_create_depthstencil_view(void) }; #undef FMT_UNKNOWN #undef D24S8 -#undef R24S8_TL +#undef R24G8_TL #undef DIM_UNKNOWN #undef TEX_1D #undef TEX_1D_ARRAY
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com