Commit 84eeeec4 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

d3d10/effect: Do not use internal value types.

parent 3a8ccb92
...@@ -40,19 +40,6 @@ ...@@ -40,19 +40,6 @@
*/ */
#define D3DERR_INVALIDCALL 0x8876086c #define D3DERR_INVALIDCALL 0x8876086c
enum d3d10_effect_object_type
{
D3D10_EOT_RASTERIZER_STATE = 0x0,
D3D10_EOT_DEPTH_STENCIL_STATE = 0x1,
D3D10_EOT_BLEND_STATE = 0x2,
D3D10_EOT_VERTEXSHADER = 0x6,
D3D10_EOT_PIXELSHADER = 0x7,
D3D10_EOT_GEOMETRYSHADER = 0x8,
D3D10_EOT_STENCIL_REF = 0x9,
D3D10_EOT_BLEND_FACTOR = 0xa,
D3D10_EOT_SAMPLE_MASK = 0xb,
};
enum d3d10_effect_object_type_flags enum d3d10_effect_object_type_flags
{ {
D3D10_EOT_FLAG_GS_SO = 0x1, D3D10_EOT_FLAG_GS_SO = 0x1,
......
...@@ -1485,36 +1485,34 @@ static HRESULT parse_fx10_annotations(const char *data, size_t data_size, const ...@@ -1485,36 +1485,34 @@ static HRESULT parse_fx10_annotations(const char *data, size_t data_size, const
return hr; return hr;
} }
static HRESULT parse_fx10_anonymous_shader(struct d3d10_effect *e, struct d3d10_effect_anonymous_shader *s, static HRESULT parse_fx10_anonymous_shader(struct d3d10_effect *e, D3D_SHADER_VARIABLE_TYPE basetype,
enum d3d10_effect_object_type otype) struct d3d10_effect_anonymous_shader *s)
{ {
struct d3d10_effect_variable *v = &s->shader; struct d3d10_effect_variable *v = &s->shader;
struct d3d10_effect_type *t = &s->type; struct d3d10_effect_type *t = &s->type;
const char *shader = NULL; const char *name = NULL;
switch (otype) switch (basetype)
{ {
case D3D10_EOT_VERTEXSHADER: case D3D10_SVT_VERTEXSHADER:
shader = "vertexshader"; name = "vertexshader";
t->basetype = D3D10_SVT_VERTEXSHADER;
break; break;
case D3D10_EOT_PIXELSHADER: case D3D10_SVT_PIXELSHADER:
shader = "pixelshader"; name = "pixelshader";
t->basetype = D3D10_SVT_PIXELSHADER;
break; break;
case D3D10_EOT_GEOMETRYSHADER: case D3D10_SVT_GEOMETRYSHADER:
shader = "geometryshader"; name = "geometryshader";
t->basetype = D3D10_SVT_GEOMETRYSHADER;
break; break;
default: default:
FIXME("Unhandled object type %#x.\n", otype); WARN("Unhandled shader type %#x.\n", basetype);
return E_FAIL; return E_FAIL;
} }
t->basetype = basetype;
if (!copy_name(shader, &t->name)) if (!copy_name(name, &t->name))
{ {
ERR("Failed to copy name.\n"); ERR("Failed to copy name.\n");
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
...@@ -1918,8 +1916,8 @@ static HRESULT parse_fx10_property_assignment(const char *data, size_t data_size ...@@ -1918,8 +1916,8 @@ static HRESULT parse_fx10_property_assignment(const char *data, size_t data_size
TRACE("Effect object starts at offset %#x.\n", value_offset); TRACE("Effect object starts at offset %#x.\n", value_offset);
if (FAILED(hr = parse_fx10_anonymous_shader(effect, if (FAILED(hr = parse_fx10_anonymous_shader(effect, property_info->type,
&effect->anonymous_shaders[effect->anonymous_shader_current], property_info->id))) &effect->anonymous_shaders[effect->anonymous_shader_current])))
return hr; return hr;
variable = &effect->anonymous_shaders[effect->anonymous_shader_current].shader; variable = &effect->anonymous_shaders[effect->anonymous_shader_current].shader;
...@@ -1938,17 +1936,17 @@ static HRESULT parse_fx10_property_assignment(const char *data, size_t data_size ...@@ -1938,17 +1936,17 @@ static HRESULT parse_fx10_property_assignment(const char *data, size_t data_size
TRACE("Stream output declaration: %s.\n", debugstr_a(variable->u.shader.stream_output_declaration)); TRACE("Stream output declaration: %s.\n", debugstr_a(variable->u.shader.stream_output_declaration));
} }
switch (property_info->id) switch (property_info->type)
{ {
case D3D10_EOT_VERTEXSHADER: case D3D10_SVT_VERTEXSHADER:
case D3D10_EOT_PIXELSHADER: case D3D10_SVT_PIXELSHADER:
case D3D10_EOT_GEOMETRYSHADER: case D3D10_SVT_GEOMETRYSHADER:
if (FAILED(hr = parse_fx10_shader(data, data_size, value_offset, variable))) if (FAILED(hr = parse_fx10_shader(data, data_size, value_offset, variable)))
return hr; return hr;
break; break;
default: default:
FIXME("Unhandled object type %#x\n", property_info->id); WARN("Unexpected shader type %#x.\n", property_info->type);
return E_FAIL; return E_FAIL;
} }
......
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