Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/wined3d/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 10cfa25a4cdc..e6a6244ff5e8 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -4150,7 +4150,7 @@ const char *debug_d3ddevicetype(enum wined3d_device_type device_type)
const char *wined3d_debug_resource_access(DWORD access) { - char buf[91]; + char buf[124];
buf[0] = '\0'; #define ACCESS_TO_STR(x) if (access & x) { strcat(buf, " | "#x); access &= ~x; }
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/d3d10core/tests/device.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index 0903ab174233..e8f933672276 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -892,6 +892,20 @@ static void get_device_adapter_desc(ID3D10Device *device, DXGI_ADAPTER_DESC *ada IDXGIAdapter_Release(adapter); }
+static void print_adapter_info(void) +{ + DXGI_ADAPTER_DESC adapter_desc; + ID3D10Device *device; + + if (!(device = create_device())) + return; + + get_device_adapter_desc(device, &adapter_desc); + trace("Adapter: %s, %04x:%04x.\n", wine_dbgstr_w(adapter_desc.Description), + adapter_desc.VendorId, adapter_desc.DeviceId); + ID3D10Device_Release(device); +} + static BOOL is_warp_device(ID3D10Device *device) { DXGI_ADAPTER_DESC adapter_desc; @@ -14852,6 +14866,8 @@ done:
START_TEST(device) { + print_adapter_info(); + test_feature_level(); test_device_interfaces(); test_create_texture2d();
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/d3d10core/tests/Makefile.in | 2 +- dlls/d3d10core/tests/device.c | 65 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 64 insertions(+), 3 deletions(-)
diff --git a/dlls/d3d10core/tests/Makefile.in b/dlls/d3d10core/tests/Makefile.in index 386840a9bc3b..6401cc8473ad 100644 --- a/dlls/d3d10core/tests/Makefile.in +++ b/dlls/d3d10core/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = d3d10core.dll -IMPORTS = d3d10 user32 +IMPORTS = d3d10 dxgi user32
C_SRCS = \ device.c diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index e8f933672276..6b8773a0b716 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -19,7 +19,7 @@ #include <assert.h> #define COBJMACROS #include "initguid.h" -#include "d3d11.h" +#include "d3d11_4.h" #include "wine/test.h" #include <limits.h>
@@ -862,12 +862,61 @@ static void check_texture_uvec4_(unsigned int line, ID3D10Texture2D *texture, check_texture_sub_resource_uvec4_(line, texture, sub_resource_idx, NULL, expected_value); }
+static BOOL use_warp_adapter; +static unsigned int use_adapter_idx; + +static IDXGIAdapter *create_adapter(void) +{ + IDXGIFactory4 *factory4; + IDXGIFactory *factory; + IDXGIAdapter *adapter; + HRESULT hr; + + if (!use_warp_adapter && !use_adapter_idx) + return NULL; + + if (FAILED(hr = CreateDXGIFactory(&IID_IDXGIFactory, (void **)&factory))) + { + trace("Failed to create IDXGIFactory, hr %#x.\n", hr); + return NULL; + } + + adapter = NULL; + if (use_warp_adapter) + { + if (SUCCEEDED(hr = IDXGIFactory_QueryInterface(factory, &IID_IDXGIFactory4, (void **)&factory4))) + { + hr = IDXGIFactory4_EnumWarpAdapter(factory4, &IID_IDXGIAdapter, (void **)&adapter); + IDXGIFactory4_Release(factory4); + } + else + { + trace("Failed to get IDXGIFactory4, hr %#x.\n", hr); + } + } + else + { + hr = IDXGIFactory_EnumAdapters(factory, use_adapter_idx, &adapter); + } + IDXGIFactory_Release(factory); + if (FAILED(hr)) + trace("Failed to get adapter, hr %#x.\n", hr); + return adapter; +} + static ID3D10Device *create_device(void) { + IDXGIAdapter *adapter; ID3D10Device *device; + HRESULT hr;
- if (SUCCEEDED(D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, 0, D3D10_SDK_VERSION, &device))) + adapter = create_adapter(); + hr = D3D10CreateDevice(adapter, D3D10_DRIVER_TYPE_HARDWARE, NULL, 0, D3D10_SDK_VERSION, &device); + if (adapter) + IDXGIAdapter_Release(adapter); + if (SUCCEEDED(hr)) return device; + if (SUCCEEDED(D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_WARP, NULL, 0, D3D10_SDK_VERSION, &device))) return device; if (SUCCEEDED(D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_REFERENCE, NULL, 0, D3D10_SDK_VERSION, &device))) @@ -14866,6 +14915,18 @@ done:
START_TEST(device) { + unsigned int argc, i; + char **argv; + + argc = winetest_get_mainargs(&argv); + for (i = 2; i < argc; ++i) + { + if (!strcmp(argv[i], "--warp")) + use_warp_adapter = TRUE; + else if (!strcmp(argv[i], "--adapter") && i + 1 < argc) + use_adapter_idx = atoi(argv[++i]); + } + print_adapter_info();
test_feature_level();
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/d3d10core/tests/device.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index 6b8773a0b716..2a8169a0636a 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -14590,6 +14590,8 @@ static void test_generate_mips(void) if (is_warp_device(device)) { win_skip("Creating the next texture crashes WARP on some testbot boxes.\n"); + HeapFree(GetProcessHeap(), 0, zero_data); + HeapFree(GetProcessHeap(), 0, data); ID3D10SamplerState_Release(sampler_state); ID3D10PixelShader_Release(ps_3d); ID3D10PixelShader_Release(ps); @@ -14687,6 +14689,7 @@ static void test_generate_mips(void)
ID3D10Resource_Release(resource);
+ HeapFree(GetProcessHeap(), 0, zero_data); HeapFree(GetProcessHeap(), 0, data);
ID3D10SamplerState_Release(sampler_state);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- Thanks.
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/d3d10core/tests/device.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index 2a8169a0636a..7b28e016c4b6 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -20,6 +20,7 @@ #define COBJMACROS #include "initguid.h" #include "d3d11_4.h" +#include "wine/heap.h" #include "wine/test.h" #include <limits.h>
@@ -2567,7 +2568,7 @@ static void test_render_target_views(void) texture_desc.CPUAccessFlags = 0; texture_desc.MiscFlags = 0;
- data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, texture_desc.Width * texture_desc.Height * 4); + data = heap_alloc_zero(texture_desc.Width * texture_desc.Height * 4); ok(!!data, "Failed to allocate memory.\n");
for (i = 0; i < ARRAY_SIZE(tests); ++i) @@ -2608,7 +2609,7 @@ static void test_render_target_views(void) ID3D10Texture2D_Release(texture); }
- HeapFree(GetProcessHeap(), 0, data); + heap_free(data); release_test_context(&test_context); }
@@ -8421,7 +8422,7 @@ static void test_resource_access(void)
data.SysMemPitch = 0; data.SysMemSlicePitch = 0; - data.pSysMem = HeapAlloc(GetProcessHeap(), 0, 10240); + data.pSysMem = heap_alloc(10240); ok(!!data.pSysMem, "Failed to allocate memory.\n");
for (i = 0; i < ARRAY_SIZE(tests); ++i) @@ -8568,7 +8569,7 @@ static void test_resource_access(void) } }
- HeapFree(GetProcessHeap(), 0, (void *)data.pSysMem); + heap_free((void *)data.pSysMem);
refcount = ID3D10Device_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); @@ -12760,7 +12761,7 @@ static void test_buffer_srv(void) resource_data.SysMemSlicePitch = 0; if (current_buffer->data_offset) { - data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, current_buffer->byte_count); + data = heap_alloc_zero(current_buffer->byte_count); ok(!!data, "Failed to allocate memory.\n"); memcpy(data + current_buffer->data_offset, current_buffer->data, current_buffer->byte_count - current_buffer->data_offset); @@ -12772,7 +12773,7 @@ static void test_buffer_srv(void) } hr = ID3D10Device_CreateBuffer(device, &buffer_desc, &resource_data, &buffer); ok(SUCCEEDED(hr), "Test %u: Failed to create buffer, hr %#x.\n", i, hr); - HeapFree(GetProcessHeap(), 0, data); + heap_free(data); } else { @@ -14401,7 +14402,7 @@ static void test_generate_mips(void) ok(SUCCEEDED(hr), "Failed to create sampler state, hr %#x.\n", hr); ID3D10Device_PSSetSamplers(device, 0, 1, &sampler_state);
- data = HeapAlloc(GetProcessHeap(), 0, sizeof(*data) * 32 * 32 * 32); + data = heap_alloc(sizeof(*data) * 32 * 32 * 32);
for (z = 0; z < 32; ++z) { @@ -14428,7 +14429,7 @@ static void test_generate_mips(void) } }
- zero_data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*zero_data) * 16 * 16 * 16); + zero_data = heap_alloc_zero(sizeof(*zero_data) * 16 * 16 * 16);
for (i = 0; i < ARRAY_SIZE(resource_types); ++i) { @@ -14590,8 +14591,8 @@ static void test_generate_mips(void) if (is_warp_device(device)) { win_skip("Creating the next texture crashes WARP on some testbot boxes.\n"); - HeapFree(GetProcessHeap(), 0, zero_data); - HeapFree(GetProcessHeap(), 0, data); + heap_free(zero_data); + heap_free(data); ID3D10SamplerState_Release(sampler_state); ID3D10PixelShader_Release(ps_3d); ID3D10PixelShader_Release(ps); @@ -14689,8 +14690,8 @@ static void test_generate_mips(void)
ID3D10Resource_Release(resource);
- HeapFree(GetProcessHeap(), 0, zero_data); - HeapFree(GetProcessHeap(), 0, data); + heap_free(zero_data); + heap_free(data);
ID3D10SamplerState_Release(sampler_state); ID3D10PixelShader_Release(ps_3d);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/d3d11/tests/d3d11.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 35551d0788d7..5a36bc285956 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -25,6 +25,7 @@ #define COBJMACROS #include "initguid.h" #include "d3d11_4.h" +#include "wine/heap.h" #include "wine/test.h"
#ifndef ARRAY_SIZE @@ -8198,7 +8199,7 @@ static void test_render_target_views(void) texture_desc.CPUAccessFlags = 0; texture_desc.MiscFlags = 0;
- data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, texture_desc.Width * texture_desc.Height * 4); + data = heap_alloc_zero(texture_desc.Width * texture_desc.Height * 4); ok(!!data, "Failed to allocate memory.\n");
for (i = 0; i < ARRAY_SIZE(tests); ++i) @@ -8282,7 +8283,7 @@ static void test_render_target_views(void) ID3D11Resource_Release(resource); }
- HeapFree(GetProcessHeap(), 0, data); + heap_free(data); release_test_context(&test_context); }
@@ -11154,7 +11155,7 @@ static void test_resource_access(const D3D_FEATURE_LEVEL feature_level)
data.SysMemPitch = 0; data.SysMemSlicePitch = 0; - data.pSysMem = HeapAlloc(GetProcessHeap(), 0, 10240); + data.pSysMem = heap_alloc(10240); ok(!!data.pSysMem, "Failed to allocate memory.\n");
for (i = 0; i < ARRAY_SIZE(tests); ++i) @@ -11339,7 +11340,7 @@ static void test_resource_access(const D3D_FEATURE_LEVEL feature_level) } }
- HeapFree(GetProcessHeap(), 0, (void *)data.pSysMem); + heap_free((void *)data.pSysMem);
ID3D11DeviceContext_Release(context); refcount = ID3D11Device_Release(device); @@ -19221,7 +19222,7 @@ static void test_buffer_srv(void) resource_data.SysMemSlicePitch = 0; if (current_buffer->data_offset) { - data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, current_buffer->byte_count); + data = heap_alloc_zero(current_buffer->byte_count); ok(!!data, "Failed to allocate memory.\n"); memcpy(data + current_buffer->data_offset, current_buffer->data, current_buffer->byte_count - current_buffer->data_offset); @@ -19233,7 +19234,7 @@ static void test_buffer_srv(void) } hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &resource_data, &buffer); ok(SUCCEEDED(hr), "Test %u: Failed to create buffer, hr %#x.\n", i, hr); - HeapFree(GetProcessHeap(), 0, data); + heap_free(data); } else { @@ -22786,7 +22787,7 @@ static void test_depth_bias(void) rasterizer_desc.SlopeScaledDepthBias = 0.0f; rasterizer_desc.DepthClipEnable = TRUE;
- depth_values = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*depth_values) * swapchain_desc.height); + depth_values = heap_calloc(swapchain_desc.height, sizeof(*depth_values)); ok(!!depth_values, "Failed to allocate memory.\n");
for (format_idx = 0; format_idx < ARRAY_SIZE(formats); ++format_idx) @@ -22988,7 +22989,7 @@ static void test_depth_bias(void) ID3D11DepthStencilView_Release(dsv); }
- HeapFree(GetProcessHeap(), 0, depth_values); + heap_free(depth_values); release_test_context(&test_context); }
@@ -24514,7 +24515,7 @@ static void test_generate_mips(void) ok(SUCCEEDED(hr), "Failed to create sampler state, hr %#x.\n", hr); ID3D11DeviceContext_PSSetSamplers(context, 0, 1, &sampler_state);
- data = HeapAlloc(GetProcessHeap(), 0, sizeof(*data) * 32 * 32 * 32); + data = heap_alloc(sizeof(*data) * 32 * 32 * 32);
for (z = 0; z < 32; ++z) { @@ -24541,7 +24542,7 @@ static void test_generate_mips(void) } }
- zero_data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*zero_data) * 16 * 16 * 16); + zero_data = heap_alloc_zero(sizeof(*zero_data) * 16 * 16 * 16);
for (i = 0; i < ARRAY_SIZE(resource_types); ++i) { @@ -24791,8 +24792,8 @@ static void test_generate_mips(void)
ID3D11Resource_Release(resource);
- HeapFree(GetProcessHeap(), 0, zero_data); - HeapFree(GetProcessHeap(), 0, data); + heap_free(zero_data); + heap_free(data);
ID3D11SamplerState_Release(sampler_state); ID3D11PixelShader_Release(ps_3d);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/wined3d/context.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 9b6c19ef6541..6b1bc3a658e4 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -282,6 +282,10 @@ static void context_dump_fbo_attachment(const struct wined3d_gl_info *gl_info, G gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(face, level, GL_TEXTURE_INTERNAL_FORMAT, &fmt); gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(face, level, GL_TEXTURE_WIDTH, &width); gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(face, level, GL_TEXTURE_HEIGHT, &height); + if (gl_info->supported[ARB_TEXTURE_MULTISAMPLE]) + gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(face, level, GL_TEXTURE_SAMPLES, &samples); + else + samples = 1;
tex_target = GL_TEXTURE_CUBE_MAP; tex_type_str = "cube";
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/wined3d/context.c | 120 +++++++++++++++++++++++-------------------------- 1 file changed, 57 insertions(+), 63 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 6b1bc3a658e4..d4c859ec143b 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -208,7 +208,6 @@ static void context_attach_surface_fbo(struct wined3d_context *context,
if (resource->object) { - if (rb_namespace) { gl_info->fbo_ops.glFramebufferRenderbuffer(fbo_target, GL_COLOR_ATTACHMENT0 + idx, @@ -241,11 +240,14 @@ static void context_dump_fbo_attachment(const struct wined3d_gl_info *gl_info, G {GL_TEXTURE_2D, GL_TEXTURE_BINDING_2D, "2d", WINED3D_GL_EXT_NONE}, {GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_BINDING_RECTANGLE_ARB, "rectangle", ARB_TEXTURE_RECTANGLE}, {GL_TEXTURE_2D_ARRAY, GL_TEXTURE_BINDING_2D_ARRAY, "2d-array" , EXT_TEXTURE_ARRAY}, + {GL_TEXTURE_CUBE_MAP, GL_TEXTURE_BINDING_CUBE_MAP, "cube", ARB_TEXTURE_CUBE_MAP}, {GL_TEXTURE_2D_MULTISAMPLE, GL_TEXTURE_BINDING_2D_MULTISAMPLE, "2d-ms", ARB_TEXTURE_MULTISAMPLE}, {GL_TEXTURE_2D_MULTISAMPLE_ARRAY, GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY, "2d-array-ms", ARB_TEXTURE_MULTISAMPLE}, };
GLint type, name, samples, width, height, old_texture, level, face, fmt, tex_target; + const char *tex_type_str; + unsigned int i;
gl_info->fbo_ops.glGetFramebufferAttachmentParameteriv(target, attachment, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, &name); @@ -267,95 +269,85 @@ static void context_dump_fbo_attachment(const struct wined3d_gl_info *gl_info, G } else if (type == GL_TEXTURE) { - const char *tex_type_str; - gl_info->fbo_ops.glGetFramebufferAttachmentParameteriv(target, attachment, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, &level); gl_info->fbo_ops.glGetFramebufferAttachmentParameteriv(target, attachment, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE, &face);
- if (face) + if (gl_info->gl_ops.ext.p_glGetTextureParameteriv) { - gl_info->gl_ops.gl.p_glGetIntegerv(GL_TEXTURE_BINDING_CUBE_MAP, &old_texture); + GL_EXTCALL(glGetTextureParameteriv(name, GL_TEXTURE_TARGET, &tex_target));
+ for (i = 0; i < ARRAY_SIZE(texture_type); ++i) + { + if (texture_type[i].target == tex_target) + { + tex_type_str = texture_type[i].str; + break; + } + } + if (i == ARRAY_SIZE(texture_type)) + tex_type_str = wine_dbg_sprintf("%#x", tex_target); + } + else if (face) + { + gl_info->gl_ops.gl.p_glGetIntegerv(GL_TEXTURE_BINDING_CUBE_MAP, &old_texture); gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP, name); - gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(face, level, GL_TEXTURE_INTERNAL_FORMAT, &fmt); - gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(face, level, GL_TEXTURE_WIDTH, &width); - gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(face, level, GL_TEXTURE_HEIGHT, &height); - if (gl_info->supported[ARB_TEXTURE_MULTISAMPLE]) - gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(face, level, GL_TEXTURE_SAMPLES, &samples); - else - samples = 1;
tex_target = GL_TEXTURE_CUBE_MAP; tex_type_str = "cube"; } else { - unsigned int i; - tex_type_str = NULL; - if (gl_info->gl_ops.ext.p_glGetTextureParameteriv) - { - GL_EXTCALL(glGetTextureParameteriv(name, GL_TEXTURE_TARGET, &tex_target)); - - for (i = 0; i < ARRAY_SIZE(texture_type); ++i) - { - if (texture_type[i].target == tex_target) - { - tex_type_str = texture_type[i].str; - break; - } - } - if (i == ARRAY_SIZE(texture_type)) - tex_type_str = wine_dbg_sprintf("%#x", tex_target);
- GL_EXTCALL(glGetTextureLevelParameteriv(name, level, GL_TEXTURE_INTERNAL_FORMAT, &fmt)); - GL_EXTCALL(glGetTextureLevelParameteriv(name, level, GL_TEXTURE_WIDTH, &width)); - GL_EXTCALL(glGetTextureLevelParameteriv(name, level, GL_TEXTURE_HEIGHT, &height)); - GL_EXTCALL(glGetTextureLevelParameteriv(name, level, GL_TEXTURE_SAMPLES, &samples)); - } - else + for (i = 0; i < ARRAY_SIZE(texture_type); ++i) { - for (i = 0; i < ARRAY_SIZE(texture_type); ++i) - { - if (!gl_info->supported[texture_type[i].extension]) - continue; + if (!gl_info->supported[texture_type[i].extension]) + continue;
- gl_info->gl_ops.gl.p_glGetIntegerv(texture_type[i].binding, &old_texture); - while (gl_info->gl_ops.gl.p_glGetError()); + gl_info->gl_ops.gl.p_glGetIntegerv(texture_type[i].binding, &old_texture); + while (gl_info->gl_ops.gl.p_glGetError());
- gl_info->gl_ops.gl.p_glBindTexture(texture_type[i].target, name); - if (!gl_info->gl_ops.gl.p_glGetError()) - { - tex_target = texture_type[i].target; - tex_type_str = texture_type[i].str; - break; - } - gl_info->gl_ops.gl.p_glBindTexture(texture_type[i].target, old_texture); - } - if (!tex_type_str) + gl_info->gl_ops.gl.p_glBindTexture(texture_type[i].target, name); + if (!gl_info->gl_ops.gl.p_glGetError()) { - FIXME("Cannot find type of texture %d.\n", name); - return; + tex_target = texture_type[i].target; + tex_type_str = texture_type[i].str; + break; } + gl_info->gl_ops.gl.p_glBindTexture(texture_type[i].target, old_texture); + }
- gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(tex_target, level, GL_TEXTURE_INTERNAL_FORMAT, &fmt); - gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(tex_target, level, GL_TEXTURE_WIDTH, &width); - gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(tex_target, level, GL_TEXTURE_HEIGHT, &height); - if (gl_info->supported[ARB_TEXTURE_MULTISAMPLE]) - gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(tex_target, level, GL_TEXTURE_SAMPLES, &samples); - else - samples = 1; - - gl_info->gl_ops.gl.p_glBindTexture(tex_target, old_texture); + if (!tex_type_str) + { + FIXME("Cannot find type of texture %d.\n", name); + return; } }
+ if (gl_info->gl_ops.ext.p_glGetTextureParameteriv) + { + GL_EXTCALL(glGetTextureLevelParameteriv(name, level, GL_TEXTURE_INTERNAL_FORMAT, &fmt)); + GL_EXTCALL(glGetTextureLevelParameteriv(name, level, GL_TEXTURE_WIDTH, &width)); + GL_EXTCALL(glGetTextureLevelParameteriv(name, level, GL_TEXTURE_HEIGHT, &height)); + GL_EXTCALL(glGetTextureLevelParameteriv(name, level, GL_TEXTURE_SAMPLES, &samples)); + } + else + { + gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(tex_target, level, GL_TEXTURE_INTERNAL_FORMAT, &fmt); + gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(tex_target, level, GL_TEXTURE_WIDTH, &width); + gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(tex_target, level, GL_TEXTURE_HEIGHT, &height); + if (gl_info->supported[ARB_TEXTURE_MULTISAMPLE]) + gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(tex_target, level, GL_TEXTURE_SAMPLES, &samples); + else + samples = 1; + + gl_info->gl_ops.gl.p_glBindTexture(tex_target, old_texture); + } + FIXME(" %s: %s texture %d, %dx%d, %d samples, format %#x.\n", debug_fboattachment(attachment), tex_type_str, name, width, height, samples, fmt); - - checkGLcall("guess texture type"); } else if (type == GL_NONE) { @@ -365,6 +357,8 @@ static void context_dump_fbo_attachment(const struct wined3d_gl_info *gl_info, G { ERR(" %s: Unknown attachment %#x.\n", debug_fboattachment(attachment), type); } + + checkGLcall("dump FBO attachment"); }
/* Context activation is done by the caller. */
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
On 21 February 2018 at 02:29, Józef Kucia jkucia@codeweavers.com wrote:
const char *wined3d_debug_resource_access(DWORD access) {
- char buf[91];
- char buf[124];
Actually, as Paul pointed out, I think that should be 125.
On Wed, Feb 21, 2018 at 1:31 PM, Henri Verbeet hverbeet@gmail.com wrote:
On 21 February 2018 at 02:29, Józef Kucia jkucia@codeweavers.com wrote:
const char *wined3d_debug_resource_access(DWORD access) {
- char buf[91];
- char buf[124];
Actually, as Paul pointed out, I think that should be 125.
Yes, 125 is the correct value.