Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/directx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 1f892a9d48e8..b0cb6ad88a3a 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -2990,7 +2990,7 @@ static struct wined3d_adapter *wined3d_adapter_no3d_create(unsigned int ordinal,
if (!wined3d_adapter_no3d_init_format_info(adapter)) { - heap_free(adapter); + adapter_no3d_destroy(adapter); return NULL; }
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- v3: Properly clean up on driver info initialization failure, use bool instead of BOOL.
dlls/wined3d/adapter_gl.c | 8 ++++++-- dlls/wined3d/adapter_vk.c | 13 +++++++------ dlls/wined3d/directx.c | 22 ++++++++++++---------- dlls/wined3d/wined3d_private.h | 2 +- 4 files changed, 26 insertions(+), 19 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index cc78c9046b6c..5bf9d179e4da 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -5214,8 +5214,12 @@ static BOOL wined3d_adapter_gl_init(struct wined3d_adapter_gl *adapter_gl, gl_info->supported[ARB_TEXTURE_STORAGE] = FALSE; }
- wined3d_driver_info_init(driver_info, caps_gl_ctx.gpu_description, adapter_gl->a.d3d_info.feature_level, - caps_gl_ctx.vram_bytes, 0); + if (!wined3d_driver_info_init(driver_info, caps_gl_ctx.gpu_description, adapter_gl->a.d3d_info.feature_level, + caps_gl_ctx.vram_bytes, 0)) + { + wined3d_caps_gl_ctx_destroy(&caps_gl_ctx); + return FALSE; + } TRACE("Reporting (fake) driver version 0x%08x-0x%08x.\n", driver_info->version_high, driver_info->version_low);
diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c index cbfb29cdd43b..9aaca15ca86a 100644 --- a/dlls/wined3d/adapter_vk.c +++ b/dlls/wined3d/adapter_vk.c @@ -2037,7 +2037,7 @@ static enum wined3d_display_driver guess_display_driver(enum wined3d_pci_vendor } }
-static void adapter_vk_init_driver_info(struct wined3d_adapter_vk *adapter_vk, +static BOOL adapter_vk_init_driver_info(struct wined3d_adapter_vk *adapter_vk, const VkPhysicalDeviceProperties *properties) { const VkPhysicalDeviceMemoryProperties *memory_properties = &adapter_vk->memory_properties; @@ -2082,10 +2082,8 @@ static void adapter_vk_init_driver_info(struct wined3d_adapter_vk *adapter_vk, gpu_description = &description; }
- wined3d_driver_info_init(&adapter_vk->a.driver_info, gpu_description, adapter_vk->a.d3d_info.feature_level, - vram_bytes, sysmem_bytes); - TRACE("Reporting (fake) driver version 0x%08x-0x%08x.\n", - adapter_vk->a.driver_info.version_high, adapter_vk->a.driver_info.version_low); + return wined3d_driver_info_init(&adapter_vk->a.driver_info, gpu_description, + adapter_vk->a.d3d_info.feature_level, vram_bytes, sysmem_bytes); }
static enum wined3d_feature_level feature_level_from_caps(const struct shader_caps *shader_caps) @@ -2209,7 +2207,10 @@ static BOOL wined3d_adapter_vk_init(struct wined3d_adapter_vk *adapter_vk,
wined3d_adapter_vk_init_d3d_info(adapter_vk, wined3d_creation_flags);
- adapter_vk_init_driver_info(adapter_vk, &properties2.properties); + if (!adapter_vk_init_driver_info(adapter_vk, &properties2.properties)) + goto fail; + TRACE("Reporting (fake) driver version 0x%08x-0x%08x.\n", + adapter_vk->a.driver_info.version_high, adapter_vk->a.driver_info.version_low); adapter->vram_bytes_used = 0; TRACE("Emulating 0x%s bytes of video ram.\n", wine_dbgstr_longlong(adapter->driver_info.vram_bytes));
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index b0cb6ad88a3a..51cb3564974a 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -671,7 +671,7 @@ static void wined3d_copy_name(char *dst, const char *src, unsigned int dst_size) } }
-void wined3d_driver_info_init(struct wined3d_driver_info *driver_info, +bool wined3d_driver_info_init(struct wined3d_driver_info *driver_info, const struct wined3d_gpu_description *gpu_desc, enum wined3d_feature_level feature_level, UINT64 vram_bytes, UINT64 sysmem_bytes) { @@ -848,15 +848,13 @@ void wined3d_driver_info_init(struct wined3d_driver_info *driver_info, driver_info->name = version_info->driver_name; driver_info->version_high = MAKEDWORD_VERSION(driver_os_version, driver_feature_level); driver_info->version_low = MAKEDWORD_VERSION(version_info->subversion, version_info->build); + + return TRUE; } - else - { - ERR("No driver version info found for device %04x:%04x, driver model %#x.\n", - driver_info->vendor, driver_info->device, driver_model); - driver_info->name = "Display"; - driver_info->version_high = MAKEDWORD_VERSION(driver_os_version, driver_feature_level); - driver_info->version_low = MAKEDWORD_VERSION(8, 6); /* NVIDIA RIVA TNT, arbitrary */ - } + + ERR("No driver version info found for device %04x:%04x, driver model %#x.\n", + driver_info->vendor, driver_info->device, driver_model); + return FALSE; }
enum wined3d_pci_device wined3d_gpu_from_feature_level(enum wined3d_pci_vendor *vendor, @@ -2994,7 +2992,11 @@ static struct wined3d_adapter *wined3d_adapter_no3d_create(unsigned int ordinal, return NULL; }
- wined3d_driver_info_init(&adapter->driver_info, &gpu_description, WINED3D_FEATURE_LEVEL_NONE, 0, 0); + if (!wined3d_driver_info_init(&adapter->driver_info, &gpu_description, WINED3D_FEATURE_LEVEL_NONE, 0, 0)) + { + adapter_no3d_destroy(adapter); + return NULL; + } adapter->vram_bytes_used = 0; TRACE("Emulating 0x%s bytes of video ram.\n", wine_dbgstr_longlong(adapter->driver_info.vram_bytes));
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index bb79173c383c..4f9b55f81697 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3198,7 +3198,7 @@ struct wined3d_driver_info DWORD version_low; };
-void wined3d_driver_info_init(struct wined3d_driver_info *driver_info, +bool wined3d_driver_info_init(struct wined3d_driver_info *driver_info, const struct wined3d_gpu_description *gpu_description, enum wined3d_feature_level feature_level, UINT64 vram_bytes, UINT64 sysmem_bytes) DECLSPEC_HIDDEN;
We currently don't have any way to copy the depth buffer from the DRAWABLE to the TEXTURE location, aside from FBOs.
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- v2: Do it in the proper place i.e. query_internal_format(). v3: Also do it in the ARB_internalformat_query2 path.
dlls/wined3d/utils.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index eaa391fafbef..8d790c52945e 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -3034,15 +3034,17 @@ static void query_internal_format(struct wined3d_adapter *adapter,
if ((format->f.flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_SRGB_WRITE) && !srgb_write_supported) format_clear_flag(&format->f, WINED3DFMT_FLAG_SRGB_WRITE); + }
- if (!gl_info->supported[ARB_DEPTH_TEXTURE] && (format->f.depth_size || format->f.stencil_size)) - { - format->f.flags[WINED3D_GL_RES_TYPE_TEX_1D] &= ~WINED3DFMT_FLAG_TEXTURE; - format->f.flags[WINED3D_GL_RES_TYPE_TEX_2D] &= ~WINED3DFMT_FLAG_TEXTURE; - format->f.flags[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3DFMT_FLAG_TEXTURE; - format->f.flags[WINED3D_GL_RES_TYPE_TEX_CUBE] &= ~WINED3DFMT_FLAG_TEXTURE; - format->f.flags[WINED3D_GL_RES_TYPE_TEX_RECT] &= ~WINED3DFMT_FLAG_TEXTURE; - } + if ((!gl_info->supported[ARB_DEPTH_TEXTURE] || wined3d_settings.offscreen_rendering_mode != ORM_FBO) + && (format->f.depth_size || format->f.stencil_size)) + { + TRACE("Disabling texturing support for depth / stencil format %s.\n", debug_d3dformat(format->f.id)); + format->f.flags[WINED3D_GL_RES_TYPE_TEX_1D] &= ~WINED3DFMT_FLAG_TEXTURE; + format->f.flags[WINED3D_GL_RES_TYPE_TEX_2D] &= ~WINED3DFMT_FLAG_TEXTURE; + format->f.flags[WINED3D_GL_RES_TYPE_TEX_3D] &= ~WINED3DFMT_FLAG_TEXTURE; + format->f.flags[WINED3D_GL_RES_TYPE_TEX_CUBE] &= ~WINED3DFMT_FLAG_TEXTURE; + format->f.flags[WINED3D_GL_RES_TYPE_TEX_RECT] &= ~WINED3DFMT_FLAG_TEXTURE; }
query_view_class(format);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/directx.c | 1 + dlls/wined3d/wined3d_private.h | 1 + 2 files changed, 2 insertions(+)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 51cb3564974a..3901ef39c119 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -507,6 +507,7 @@ static const struct wined3d_gpu_description gpu_description_table[] = {HW_VENDOR_AMD, CARD_AMD_RADEON_RX_480, "Radeon (TM) RX 480 Graphics", DRIVER_AMD_RX, 4096}, {HW_VENDOR_AMD, CARD_AMD_RADEON_RX_VEGA_10, "Radeon RX Vega", DRIVER_AMD_RX, 8192}, {HW_VENDOR_AMD, CARD_AMD_RADEON_RX_VEGA_12, "Radeon Pro Vega 20", DRIVER_AMD_RX, 4096}, + {HW_VENDOR_AMD, CARD_AMD_RADEON_RAVEN, "AMD Radeon(TM) Vega 10 Mobile Graphics", DRIVER_AMD_RX, 1024}, {HW_VENDOR_AMD, CARD_AMD_RADEON_RX_VEGA_20, "Radeon RX Vega 20", DRIVER_AMD_RX, 4096}, {HW_VENDOR_AMD, CARD_AMD_RADEON_RX_NAVI_10, "Radeon RX 5700 / 5700 XT", DRIVER_AMD_RX, 8192},
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 4f9b55f81697..83d790936f74 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2814,6 +2814,7 @@ enum wined3d_pci_device CARD_AMD_RADEON_RX_480 = 0x67df, CARD_AMD_RADEON_RX_VEGA_10 = 0x687f, CARD_AMD_RADEON_RX_VEGA_12 = 0x69af, + CARD_AMD_RADEON_RAVEN = 0x15dd, CARD_AMD_RADEON_RX_VEGA_20 = 0x66af, CARD_AMD_RADEON_RX_NAVI_10 = 0x731f,
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/glsl_shader.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 66e90b176804..a14682c95ac8 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -6053,10 +6053,9 @@ static void shader_glsl_sample(const struct wined3d_shader_instruction *ins) shader_glsl_release_sample_function(ins->ctx, &sample_function); }
-/* GLSL doesn't provide a function to sample from level zero with depth - * comparison for array textures and cube textures. We use textureGrad*() - * to implement sample_c_lz. - */ +/* Unless EXT_texture_shadow_lod is available, GLSL doesn't provide a function + * to sample from level zero with depth comparison for array textures and cube + * textures. We use textureGrad*() to implement sample_c_lz in that case. */ static void shader_glsl_gen_sample_c_lz_emulation(const struct wined3d_shader_instruction *ins, unsigned int sampler_bind_idx, const struct glsl_sample_function *sample_function, unsigned int coord_size, const char *coord_param, const char *ref_param)
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
On Thu, 16 Jul 2020 at 21:20, Matteo Bruni mbruni@codeweavers.com wrote:
@@ -2990,7 +2990,7 @@ static struct wined3d_adapter *wined3d_adapter_no3d_create(unsigned int ordinal,
if (!wined3d_adapter_no3d_init_format_info(adapter)) {
heap_free(adapter);
}adapter_no3d_destroy(adapter); return NULL;
It happens to be the case that adapter_no3d_destroy() does the right thing, but I'd argue that conceptually it's more questionable. I.e., conceptually adapter_no3d_destroy() is the counterpart to wined3d_adapter_no3d_create(), and consists of wined3d_adapter_no3d_cleanup() + heap_free(). As it turns out, neither wined3d_adapter_no3d_init() nor wined3d_adapter_no3d_cleanup() actually exist, because at least at the time, wined3d_adapter_no3d_init() was considered trivial enough to just fold into wined3d_adapter_no3d_create(), and wined3d_adapter_no3d_cleanup() would likewise simply call wined3d_adapter_cleanup(). Nevertheless, we still don't have a fully initialised no3d adapter to pass to adapter_no3d_destroy() here.