Commit 68ab4c48 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

d3d10/effect: Clarify constant buffer flags field meaning.

It makes more sense to have it matching fx_5_0 format, which uses the same flag for TBUFFER case, and also keeps 'single' modifier in there. This modifier is ignored on fx_4_x, so it's only needed to be implemented in the compiler. Signed-off-by: 's avatarNikolay Sivov <nsivov@codeweavers.com>
parent 36fa4da3
...@@ -3796,10 +3796,13 @@ static HRESULT create_buffer_object(struct d3d10_effect_variable *v) ...@@ -3796,10 +3796,13 @@ static HRESULT create_buffer_object(struct d3d10_effect_variable *v)
static HRESULT parse_fx10_buffer(const char *data, size_t data_size, const char **ptr, static HRESULT parse_fx10_buffer(const char *data, size_t data_size, const char **ptr,
BOOL local, struct d3d10_effect_variable *l) BOOL local, struct d3d10_effect_variable *l)
{ {
enum buffer_flags
{
IS_TBUFFER = 1,
};
const char *prefix = local ? "Local" : "Shared"; const char *prefix = local ? "Local" : "Shared";
uint32_t offset, flags;
unsigned int i; unsigned int i;
uint32_t offset;
D3D10_CBUFFER_TYPE d3d10_cbuffer_type;
HRESULT hr; HRESULT hr;
unsigned int stride = 0; unsigned int stride = 0;
...@@ -3826,32 +3829,30 @@ static HRESULT parse_fx10_buffer(const char *data, size_t data_size, const char ...@@ -3826,32 +3829,30 @@ static HRESULT parse_fx10_buffer(const char *data, size_t data_size, const char
l->data_size = read_u32(ptr); l->data_size = read_u32(ptr);
TRACE("%s buffer data size: %#x.\n", prefix, l->data_size); TRACE("%s buffer data size: %#x.\n", prefix, l->data_size);
d3d10_cbuffer_type = read_u32(ptr); flags = read_u32(ptr);
TRACE("%s buffer type: %#x.\n", prefix, d3d10_cbuffer_type); TRACE("%s buffer flags: %#x.\n", prefix, flags);
switch(d3d10_cbuffer_type) if (flags & IS_TBUFFER)
{ {
case D3D10_CT_CBUFFER: l->type->basetype = D3D10_SVT_TBUFFER;
l->type->basetype = D3D10_SVT_CBUFFER; copy_name("tbuffer", &l->type->name);
if (!copy_name("cbuffer", &l->type->name)) }
{ else
ERR("Failed to copy name.\n"); {
return E_OUTOFMEMORY; l->type->basetype = D3D10_SVT_CBUFFER;
} copy_name("cbuffer", &l->type->name);
break; }
if (!l->type->name)
case D3D10_CT_TBUFFER: {
l->type->basetype = D3D10_SVT_TBUFFER; ERR("Failed to copy name.\n");
if (!copy_name("tbuffer", &l->type->name)) return E_OUTOFMEMORY;
{ }
ERR("Failed to copy name.\n");
return E_OUTOFMEMORY;
}
break;
default: flags &= ~IS_TBUFFER;
ERR("Unexpected D3D10_CBUFFER_TYPE %#x!\n", d3d10_cbuffer_type); if (flags)
return E_FAIL; {
ERR("Unexpected buffer flags %#x.\n", flags);
return E_FAIL;
} }
l->type->member_count = read_u32(ptr); l->type->member_count = read_u32(ptr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment