[PATCH 1/8] wined3d: Make wined3d samplers usable when ARB_sampler_objects is not available.
Józef Kucia
jkucia at codeweavers.com
Mon Mar 20 06:13:03 CDT 2017
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
dlls/wined3d/sampler.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/dlls/wined3d/sampler.c b/dlls/wined3d/sampler.c
index 72574db..a987a35 100644
--- a/dlls/wined3d/sampler.c
+++ b/dlls/wined3d/sampler.c
@@ -39,10 +39,13 @@ static void wined3d_sampler_destroy_object(void *object)
const struct wined3d_gl_info *gl_info;
struct wined3d_context *context;
- context = context_acquire(sampler->device, NULL, 0);
- gl_info = context->gl_info;
- GL_EXTCALL(glDeleteSamplers(1, &sampler->name));
- context_release(context);
+ if (sampler->name)
+ {
+ context = context_acquire(sampler->device, NULL, 0);
+ gl_info = context->gl_info;
+ GL_EXTCALL(glDeleteSamplers(1, &sampler->name));
+ context_release(context);
+ }
HeapFree(GetProcessHeap(), 0, sampler);
}
@@ -115,7 +118,9 @@ static void wined3d_sampler_init(struct wined3d_sampler *sampler, struct wined3d
sampler->device = device;
sampler->parent = parent;
sampler->desc = *desc;
- wined3d_cs_init_object(device->cs, wined3d_sampler_cs_init, sampler);
+
+ if (device->adapter->gl_info.supported[ARB_SAMPLER_OBJECTS])
+ wined3d_cs_init_object(device->cs, wined3d_sampler_cs_init, sampler);
}
HRESULT CDECL wined3d_sampler_create(struct wined3d_device *device, const struct wined3d_sampler_desc *desc,
@@ -125,9 +130,6 @@ HRESULT CDECL wined3d_sampler_create(struct wined3d_device *device, const struct
TRACE("device %p, desc %p, parent %p, sampler %p.\n", device, desc, parent, sampler);
- if (!device->adapter->gl_info.supported[ARB_SAMPLER_OBJECTS])
- return WINED3DERR_INVALIDCALL;
-
if (desc->address_u < WINED3D_TADDRESS_WRAP || desc->address_u > WINED3D_TADDRESS_MIRROR_ONCE
|| desc->address_v < WINED3D_TADDRESS_WRAP || desc->address_v > WINED3D_TADDRESS_MIRROR_ONCE
|| desc->address_w < WINED3D_TADDRESS_WRAP || desc->address_w > WINED3D_TADDRESS_MIRROR_ONCE)
--
2.10.2
More information about the wine-patches
mailing list