wined3d: Introduce WINED3D_BIND_INDIRECT_BUFFER.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
5b358e0f4c
commit
cf44283227
|
@ -448,7 +448,7 @@ static HRESULT d3d_buffer_init(struct d3d_buffer *buffer, struct d3d_device *dev
|
|||
|
||||
wined3d_desc.byte_width = buffer->desc.ByteWidth;
|
||||
wined3d_desc.usage = wined3d_usage_from_d3d11(buffer->desc.Usage);
|
||||
wined3d_desc.bind_flags = wined3d_bind_flags_from_d3d11(buffer->desc.BindFlags);
|
||||
wined3d_desc.bind_flags = wined3d_bind_flags_from_d3d11(buffer->desc.BindFlags, buffer->desc.MiscFlags);
|
||||
wined3d_desc.access = wined3d_access_from_d3d11(buffer->desc.Usage, buffer->desc.CPUAccessFlags);
|
||||
wined3d_desc.misc_flags = buffer->desc.MiscFlags;
|
||||
wined3d_desc.structure_byte_stride = buffer->desc.StructureByteStride;
|
||||
|
|
|
@ -92,14 +92,33 @@ HRESULT d3d_set_private_data(struct wined3d_private_store *store,
|
|||
HRESULT d3d_set_private_data_interface(struct wined3d_private_store *store,
|
||||
REFGUID guid, const IUnknown *object) DECLSPEC_HIDDEN;
|
||||
|
||||
static inline unsigned int wined3d_bind_flags_from_d3d11(UINT bind_flags)
|
||||
static inline unsigned int wined3d_bind_flags_from_d3d11(UINT bind_flags, UINT misc_flags)
|
||||
{
|
||||
return bind_flags;
|
||||
unsigned int wined3d_flags = bind_flags & (D3D11_BIND_VERTEX_BUFFER
|
||||
| D3D11_BIND_INDEX_BUFFER
|
||||
| D3D11_BIND_CONSTANT_BUFFER
|
||||
| D3D11_BIND_SHADER_RESOURCE
|
||||
| D3D11_BIND_STREAM_OUTPUT
|
||||
| D3D11_BIND_RENDER_TARGET
|
||||
| D3D11_BIND_DEPTH_STENCIL
|
||||
| D3D11_BIND_UNORDERED_ACCESS);
|
||||
|
||||
if (misc_flags & D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS)
|
||||
wined3d_flags |= WINED3D_BIND_INDIRECT_BUFFER;
|
||||
|
||||
return wined3d_flags;
|
||||
}
|
||||
|
||||
static inline UINT d3d11_bind_flags_from_wined3d(unsigned int bind_flags)
|
||||
{
|
||||
return bind_flags;
|
||||
return bind_flags & (WINED3D_BIND_VERTEX_BUFFER
|
||||
| WINED3D_BIND_INDEX_BUFFER
|
||||
| WINED3D_BIND_CONSTANT_BUFFER
|
||||
| WINED3D_BIND_SHADER_RESOURCE
|
||||
| WINED3D_BIND_STREAM_OUTPUT
|
||||
| WINED3D_BIND_RENDER_TARGET
|
||||
| WINED3D_BIND_DEPTH_STENCIL
|
||||
| WINED3D_BIND_UNORDERED_ACCESS);
|
||||
}
|
||||
|
||||
/* ID3D11Texture1D, ID3D10Texture1D */
|
||||
|
|
|
@ -454,7 +454,7 @@ HRESULT d3d_texture1d_create(struct d3d_device *device, const D3D11_TEXTURE1D_DE
|
|||
wined3d_desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
|
||||
wined3d_desc.multisample_quality = 0;
|
||||
wined3d_desc.usage = wined3d_usage_from_d3d11(desc->Usage);
|
||||
wined3d_desc.bind_flags = wined3d_bind_flags_from_d3d11(desc->BindFlags);
|
||||
wined3d_desc.bind_flags = wined3d_bind_flags_from_d3d11(desc->BindFlags, desc->MiscFlags);
|
||||
wined3d_desc.access = wined3d_access_from_d3d11(desc->Usage,
|
||||
desc->Usage == D3D11_USAGE_DEFAULT ? 0 : desc->CPUAccessFlags);
|
||||
wined3d_desc.width = desc->Width;
|
||||
|
@ -1008,7 +1008,7 @@ HRESULT d3d_texture2d_create(struct d3d_device *device, const D3D11_TEXTURE2D_DE
|
|||
wined3d_desc.multisample_type = desc->SampleDesc.Count > 1 ? desc->SampleDesc.Count : WINED3D_MULTISAMPLE_NONE;
|
||||
wined3d_desc.multisample_quality = desc->SampleDesc.Quality;
|
||||
wined3d_desc.usage = wined3d_usage_from_d3d11(desc->Usage);
|
||||
wined3d_desc.bind_flags = wined3d_bind_flags_from_d3d11(desc->BindFlags);
|
||||
wined3d_desc.bind_flags = wined3d_bind_flags_from_d3d11(desc->BindFlags, desc->MiscFlags);
|
||||
wined3d_desc.access = wined3d_access_from_d3d11(desc->Usage,
|
||||
desc->Usage == D3D11_USAGE_DEFAULT ? 0 : desc->CPUAccessFlags);
|
||||
wined3d_desc.width = desc->Width;
|
||||
|
@ -1467,7 +1467,7 @@ static HRESULT d3d_texture3d_init(struct d3d_texture3d *texture, struct d3d_devi
|
|||
wined3d_desc.multisample_type = WINED3D_MULTISAMPLE_NONE;
|
||||
wined3d_desc.multisample_quality = 0;
|
||||
wined3d_desc.usage = wined3d_usage_from_d3d11(desc->Usage);
|
||||
wined3d_desc.bind_flags = wined3d_bind_flags_from_d3d11(desc->BindFlags);
|
||||
wined3d_desc.bind_flags = wined3d_bind_flags_from_d3d11(desc->BindFlags, desc->MiscFlags);
|
||||
wined3d_desc.access = wined3d_access_from_d3d11(desc->Usage,
|
||||
desc->Usage == D3D11_USAGE_DEFAULT ? 0 : desc->CPUAccessFlags);
|
||||
wined3d_desc.width = desc->Width;
|
||||
|
|
|
@ -1300,6 +1300,10 @@ GLenum wined3d_buffer_gl_binding_from_bind_flags(const struct wined3d_gl_info *g
|
|||
if (bind_flags & WINED3D_BIND_STREAM_OUTPUT)
|
||||
return GL_TRANSFORM_FEEDBACK_BUFFER;
|
||||
|
||||
if (bind_flags & WINED3D_BIND_INDIRECT_BUFFER
|
||||
&& gl_info->supported[ARB_DRAW_INDIRECT])
|
||||
return GL_DRAW_INDIRECT_BUFFER;
|
||||
|
||||
if (bind_flags & ~(WINED3D_BIND_VERTEX_BUFFER | WINED3D_BIND_INDEX_BUFFER))
|
||||
FIXME("Unhandled bind flags %#x.\n", bind_flags);
|
||||
|
||||
|
|
|
@ -4687,6 +4687,7 @@ const char *wined3d_debug_bind_flags(DWORD bind_flags)
|
|||
BIND_FLAG_TO_STR(WINED3D_BIND_RENDER_TARGET);
|
||||
BIND_FLAG_TO_STR(WINED3D_BIND_DEPTH_STENCIL);
|
||||
BIND_FLAG_TO_STR(WINED3D_BIND_UNORDERED_ACCESS);
|
||||
BIND_FLAG_TO_STR(WINED3D_BIND_INDIRECT_BUFFER);
|
||||
#undef BIND_FLAG_TO_STR
|
||||
if (bind_flags)
|
||||
FIXME("Unrecognised bind flag(s) %#x.\n", bind_flags);
|
||||
|
|
|
@ -914,6 +914,7 @@ enum wined3d_shader_type
|
|||
#define WINED3D_BIND_RENDER_TARGET 0x00000020
|
||||
#define WINED3D_BIND_DEPTH_STENCIL 0x00000040
|
||||
#define WINED3D_BIND_UNORDERED_ACCESS 0x00000080
|
||||
#define WINED3D_BIND_INDIRECT_BUFFER 0x00000100
|
||||
|
||||
#define WINED3DUSAGE_SOFTWAREPROCESSING 0x00000010
|
||||
#define WINED3DUSAGE_DONOTCLIP 0x00000020
|
||||
|
|
Loading…
Reference in New Issue