wined3d: Enforce WINED3DUSAGE_RENDERTARGET format restrictions on resource creation.
This commit is contained in:
parent
6f321ff2f9
commit
b28e9f6482
|
@ -85,6 +85,13 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
|
|||
{
|
||||
const struct wined3d *d3d = device->wined3d;
|
||||
|
||||
resource_check_usage(usage);
|
||||
if (pool != WINED3D_POOL_SCRATCH)
|
||||
{
|
||||
if ((usage & WINED3DUSAGE_RENDERTARGET) && !(format->flags & WINED3DFMT_FLAG_RENDERTARGET))
|
||||
return WINED3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
resource->ref = 1;
|
||||
resource->device = device;
|
||||
resource->type = type;
|
||||
|
@ -106,8 +113,6 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
|
|||
resource->resource_ops = resource_ops;
|
||||
list_init(&resource->privateData);
|
||||
|
||||
resource_check_usage(usage);
|
||||
|
||||
if (size)
|
||||
{
|
||||
resource->heap_memory = wined3d_resource_allocate_sysmem(size);
|
||||
|
|
Loading…
Reference in New Issue