d3d10/effect: Use SamplerState.Texture when setting shader resources.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
c0e2138ed7
commit
69ae2cc7e7
|
@ -94,8 +94,6 @@ static struct d3d10_effect_variable null_matrix_variable = {{(const ID3D10Effect
|
|||
&null_local_buffer, &null_type};
|
||||
static struct d3d10_effect_variable null_string_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_string_variable_vtbl},
|
||||
&null_local_buffer, &null_type};
|
||||
static struct d3d10_effect_variable null_shader_resource_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_shader_resource_variable_vtbl},
|
||||
&null_local_buffer, &null_type};
|
||||
static struct d3d10_effect_variable null_render_target_view_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_render_target_view_variable_vtbl},
|
||||
&null_local_buffer, &null_type};
|
||||
static struct d3d10_effect_variable null_depth_stencil_view_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_depth_stencil_view_variable_vtbl},
|
||||
|
@ -111,6 +109,16 @@ static struct d3d10_effect_variable null_rasterizer_variable = {{(const ID3D10Ef
|
|||
static struct d3d10_effect_variable null_sampler_variable = {{(const ID3D10EffectVariableVtbl *)&d3d10_effect_sampler_variable_vtbl},
|
||||
&null_local_buffer, &null_type};
|
||||
|
||||
static ID3D10ShaderResourceView *null_srvs[D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT];
|
||||
|
||||
static struct d3d10_effect_variable null_shader_resource_variable =
|
||||
{
|
||||
.ID3D10EffectVariable_iface.lpVtbl = (ID3D10EffectVariableVtbl *)&d3d10_effect_shader_resource_variable_vtbl,
|
||||
.buffer = &null_local_buffer,
|
||||
.type = &null_type,
|
||||
.u.resource.srv = null_srvs,
|
||||
};
|
||||
|
||||
/* anonymous_shader_type and anonymous_shader */
|
||||
static char anonymous_name[] = "$Anonymous";
|
||||
static char anonymous_vertexshader_name[] = "vertexshader";
|
||||
|
@ -1683,6 +1691,7 @@ static BOOL read_value_list(const char *data, size_t data_size, DWORD offset,
|
|||
break;
|
||||
|
||||
case D3D10_SVT_TEXTURE:
|
||||
*(void **)out_data = &null_shader_resource_variable;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -3909,8 +3918,17 @@ static void apply_shader_resources(ID3D10Device *device, struct d3d10_effect_var
|
|||
}
|
||||
break;
|
||||
|
||||
case D3D10_SIT_TBUFFER:
|
||||
case D3D10_SIT_TEXTURE:
|
||||
|
||||
if (rsrc_v->type->basetype == D3D10_SVT_SAMPLER)
|
||||
{
|
||||
TRACE("Using texture associated with sampler %s.\n", debugstr_a(rsrc_v->name));
|
||||
rsrc_v = rsrc_v->u.state.desc.sampler.texture;
|
||||
}
|
||||
|
||||
/* fallthrough */
|
||||
case D3D10_SIT_TBUFFER:
|
||||
|
||||
if (sr->in_type == D3D10_SIT_TBUFFER)
|
||||
{
|
||||
update_buffer(device, rsrc_v);
|
||||
|
|
|
@ -4166,6 +4166,13 @@ SamplerState sampler13 { Texture = t2dmsa_a[0]; };
|
|||
SamplerState sampler14 { Texture = t3_a[1]; };
|
||||
SamplerState sampler15 { Texture = tq_a[2]; };
|
||||
|
||||
SamplerState ss { Texture = NULL; };
|
||||
|
||||
float4 PS() : COLOR
|
||||
{
|
||||
return tex2D( ss, float2(0.0f, 0.0f) );
|
||||
}
|
||||
|
||||
technique10 tech0
|
||||
{
|
||||
pass pass0
|
||||
|
@ -4174,14 +4181,18 @@ technique10 tech0
|
|||
SetDepthStencilState(ds_state, 1.0f);
|
||||
SetRasterizerState(rast_state);
|
||||
}
|
||||
pass pass1
|
||||
{
|
||||
SetPixelShader( CompileShader(ps_4_0, PS()) );
|
||||
}
|
||||
};
|
||||
#endif
|
||||
static DWORD fx_test_state_groups[] =
|
||||
{
|
||||
0x43425844, 0xad712d25, 0xfbcf4136, 0x61248434, 0xe6cabf4a, 0x00000001, 0x00000f79, 0x00000001,
|
||||
0x00000024, 0x30315846, 0x00000f4d, 0xfeff1001, 0x00000000, 0x00000000, 0x00000028, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000001, 0x00000711, 0x00000000, 0x00000024, 0x00000001, 0x00000001,
|
||||
0x00000001, 0x00000013, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x74736152,
|
||||
0x43425844, 0x61e5a938, 0x1d4228df, 0x536560dd, 0x76c777b2, 0x00000001, 0x000011ce, 0x00000001,
|
||||
0x00000024, 0x30315846, 0x000011a2, 0xfeff1001, 0x00000000, 0x00000000, 0x00000029, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000001, 0x00000922, 0x00000000, 0x00000024, 0x00000001, 0x00000001,
|
||||
0x00000001, 0x00000014, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x74736152,
|
||||
0x7a697265, 0x74537265, 0x00657461, 0x00000004, 0x00000002, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000004, 0x74736172, 0x6174735f, 0x01006574, 0x02000000, 0x02000000, 0x01000000,
|
||||
0x02000000, 0x02000000, 0x01000000, 0x04000000, 0x01000000, 0x01000000, 0x02000000, 0xfc000000,
|
||||
|
@ -4236,76 +4247,120 @@ static DWORD fx_test_state_groups[] =
|
|||
0x00000005, 0x73000000, 0x6c706d61, 0x31317265, 0x00059900, 0x00000100, 0x6d617300, 0x72656c70,
|
||||
0xbb003231, 0x02000005, 0x73000000, 0x6c706d61, 0x33317265, 0x0005df00, 0x00000000, 0x6d617300,
|
||||
0x72656c70, 0x04003431, 0x01000006, 0x73000000, 0x6c706d61, 0x35317265, 0x00062500, 0x00000200,
|
||||
0x63657400, 0x70003068, 0x30737361, 0x00000400, 0x00000100, 0x00000000, 0x0000013f, 0x19999a00,
|
||||
0x0000013f, 0x33333300, 0x0000013f, 0x4ccccd00, 0x0000013f, 0x00000300, 0x00ffff00, 0x00000100,
|
||||
0x00000100, 0x80000000, 0x0000303f, 0x00001400, 0x00000000, 0xffffff00, 0x00000aff, 0x00000c00,
|
||||
0x00000000, 0x00000100, 0x00003b00, 0x00000d00, 0x00000000, 0x00000100, 0x00004700, 0x00000e00,
|
||||
0x00000000, 0x00000100, 0x00005300, 0x00000f00, 0x00000000, 0x00000100, 0x00005f00, 0x00001000,
|
||||
0x00000000, 0x00000100, 0x00006b00, 0x00001100, 0x00000000, 0x00000100, 0x00007700, 0x00001200,
|
||||
0x00000000, 0x00000100, 0x00008300, 0x00001300, 0x00000000, 0x00000100, 0x00008f00, 0x00001400,
|
||||
0x00000000, 0x00000100, 0x00009b00, 0x00001500, 0x00000000, 0x00000100, 0x0000a700, 0x00000000,
|
||||
0x0000e100, 0x0000c500, 0x00000000, 0xffffff00, 0x00000eff, 0x00001600, 0x00000000, 0x00000100,
|
||||
0x0000ea00, 0x00001700, 0x00000000, 0x00000100, 0x0000f600, 0x00001800, 0x00000000, 0x00000100,
|
||||
0x00010200, 0x00001900, 0x00000000, 0x00000100, 0x00010e00, 0x00001a00, 0x00000000, 0x00000100,
|
||||
0x00011a00, 0x00001b00, 0x00000000, 0x00000100, 0x00012600, 0x00001c00, 0x00000000, 0x00000100,
|
||||
0x00013200, 0x00001d00, 0x00000000, 0x00000100, 0x00013e00, 0x00001e00, 0x00000000, 0x00000100,
|
||||
0x00014a00, 0x00001f00, 0x00000000, 0x00000100, 0x00015600, 0x00002000, 0x00000000, 0x00000100,
|
||||
0x00016200, 0x00002100, 0x00000000, 0x00000100, 0x00016e00, 0x00002200, 0x00000000, 0x00000100,
|
||||
0x00017a00, 0x00002300, 0x00000000, 0x00000100, 0x00018600, 0x00000000, 0x0001b900, 0x00019d00,
|
||||
0x00000000, 0xffffff00, 0x00000bff, 0x00002400, 0x00000000, 0x00000100, 0x0001c500, 0x00002500,
|
||||
0x00000000, 0x00000100, 0x0001d100, 0x00002500, 0x00000700, 0x00000100, 0x0001dd00, 0x00002600,
|
||||
0x00000000, 0x00000100, 0x0001e900, 0x00002700, 0x00000000, 0x00000100, 0x0001f500, 0x00002800,
|
||||
0x00000000, 0x00000100, 0x00020100, 0x00002900, 0x00000000, 0x00000100, 0x00020d00, 0x00002a00,
|
||||
0x00000000, 0x00000100, 0x00021900, 0x00002b00, 0x00000000, 0x00000100, 0x00022500, 0x00002c00,
|
||||
0x00000000, 0x00000100, 0x00023100, 0x00002c00, 0x00000700, 0x00000100, 0x00023d00, 0x00000000,
|
||||
0x00027200, 0x00025600, 0x00000000, 0xffffff00, 0x00000bff, 0x00002d00, 0x00000000, 0x00000100,
|
||||
0x00027b00, 0x00002e00, 0x00000000, 0x00000100, 0x00028700, 0x00002f00, 0x00000000, 0x00000100,
|
||||
0x00029300, 0x00003000, 0x00000000, 0x00000100, 0x00029f00, 0x00003100, 0x00000000, 0x00000100,
|
||||
0x0002ab00, 0x00003200, 0x00000000, 0x00000100, 0x0002b700, 0x00003300, 0x00000000, 0x00000100,
|
||||
0x0002c300, 0x00003400, 0x00000000, 0x00000100, 0x0002cf00, 0x00003500, 0x00000000, 0x00000100,
|
||||
0x0002f300, 0x00003600, 0x00000000, 0x00000100, 0x0002ff00, 0x00003700, 0x00000000, 0x00000100,
|
||||
0x00030b00, 0x00000000, 0x00033b00, 0x00031f00, 0x00000000, 0xffffff00, 0x000000ff, 0x00036400,
|
||||
0x00034800, 0x00000000, 0xffffff00, 0x000000ff, 0x00039200, 0x00037600, 0x00000000, 0xffffff00,
|
||||
0x000000ff, 0x0003bc00, 0x0003a000, 0x00000000, 0xffffff00, 0x000000ff, 0x0003ea00, 0x0003ce00,
|
||||
0x00000000, 0xffffff00, 0x000000ff, 0x00041600, 0x0003fa00, 0x00000000, 0xffffff00, 0x000000ff,
|
||||
0x00044900, 0x00042d00, 0x00000000, 0xffffff00, 0x000000ff, 0x00047600, 0x00045a00, 0x00000000,
|
||||
0xffffff00, 0x000000ff, 0x0004a100, 0x00048500, 0x00000000, 0xffffff00, 0x000000ff, 0x0004a400,
|
||||
0x00025600, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000200, 0x00033b00,
|
||||
0x00000000, 0x0004ad00, 0x00025600, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000,
|
||||
0x00000200, 0x00036400, 0x00000000, 0x0004b600, 0x00025600, 0x00000000, 0xffffff00, 0x000001ff,
|
||||
0x00003700, 0x00000000, 0x00000200, 0x00039200, 0x00000000, 0x0004c000, 0x00025600, 0x00000000,
|
||||
0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000200, 0x0003bc00, 0x00000000, 0x0004c900,
|
||||
0x00025600, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000200, 0x0003ea00,
|
||||
0x00000000, 0x0004d300, 0x00025600, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000,
|
||||
0x00000200, 0x00041600, 0x00000000, 0x0004dc00, 0x00025600, 0x00000000, 0xffffff00, 0x000001ff,
|
||||
0x00003700, 0x00000000, 0x00000200, 0x00044900, 0x00000000, 0x0004e600, 0x00025600, 0x00000000,
|
||||
0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000200, 0x00047600, 0x00000000, 0x0004ef00,
|
||||
0x00025600, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000200, 0x0004a100,
|
||||
0x00000000, 0x00051400, 0x0004f800, 0x00000000, 0xffffff00, 0x000000ff, 0x00053500, 0x00051900,
|
||||
0x00000000, 0xffffff00, 0x000000ff, 0x00055600, 0x00053a00, 0x00000000, 0xffffff00, 0x000000ff,
|
||||
0x00057800, 0x00055c00, 0x00000000, 0xffffff00, 0x000000ff, 0x00059900, 0x00057d00, 0x00000000,
|
||||
0xffffff00, 0x000000ff, 0x0005bb00, 0x00059f00, 0x00000000, 0xffffff00, 0x000000ff, 0x0005df00,
|
||||
0x0005c300, 0x00000000, 0xffffff00, 0x000000ff, 0x00060400, 0x0005e800, 0x00000000, 0xffffff00,
|
||||
0x000000ff, 0x00062500, 0x00060900, 0x00000000, 0xffffff00, 0x000000ff, 0x00062a00, 0x00025600,
|
||||
0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000300, 0x00063300, 0x00000000,
|
||||
0x00063b00, 0x00025600, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000300,
|
||||
0x00064400, 0x00000000, 0x00064c00, 0x00025600, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700,
|
||||
0x00000000, 0x00000300, 0x00065500, 0x00000000, 0x00065d00, 0x00025600, 0x00000000, 0xffffff00,
|
||||
0x000001ff, 0x00003700, 0x00000000, 0x00000300, 0x00066700, 0x00000000, 0x00066f00, 0x00025600,
|
||||
0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000300, 0x00067900, 0x00000000,
|
||||
0x00068100, 0x00025600, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000300,
|
||||
0x00068b00, 0x00000000, 0x00069300, 0x00025600, 0x00000000, 0xffffff00, 0x000001ff, 0x00003700,
|
||||
0x00000000, 0x00000300, 0x00069d00, 0x00000000, 0x0006a500, 0x00025600, 0x00000000, 0xffffff00,
|
||||
0x000001ff, 0x00003700, 0x00000000, 0x00000300, 0x0006af00, 0x00000000, 0x0006b700, 0x00025600,
|
||||
0x00000000, 0xffffff00, 0x000001ff, 0x00003700, 0x00000000, 0x00000300, 0x0006c100, 0x00000000,
|
||||
0x0006c900, 0x00000100, 0x00000000, 0x0006cf00, 0x00000600, 0x00000000, 0x00000a00, 0x00000000,
|
||||
0x00000100, 0x0006d500, 0x00000b00, 0x00000000, 0x00000100, 0x0006f900, 0x00000200, 0x00000000,
|
||||
0x00000200, 0x0001b900, 0x00000900, 0x00000000, 0x00000100, 0x00070500, 0x00000100, 0x00000000,
|
||||
0x00000200, 0x0000e100, 0x00000000, 0x00000000, 0x00000200, 0x00003000, 0x00000000,
|
||||
0x00737300, 0x00000001, 0x00000002, 0x00000000, 0x68636574, 0x61700030, 0x00307373, 0x00000004,
|
||||
0x00000001, 0x3f000000, 0x00000001, 0x3f19999a, 0x00000001, 0x3f333333, 0x00000001, 0x3f4ccccd,
|
||||
0x00000001, 0x00000003, 0x0000ffff, 0x00000001, 0x00000001, 0x3f800000, 0x73736170, 0x01f00031,
|
||||
0x58440000, 0x35034342, 0x3e91426d, 0x2799a172, 0x010d4956, 0x00016c60, 0x01f00000, 0x00050000,
|
||||
0x00340000, 0x00c40000, 0x00d40000, 0x01080000, 0x01740000, 0x44520000, 0x00884645, 0x00000000,
|
||||
0x00000000, 0x00020000, 0x001c0000, 0x04000000, 0x1100ffff, 0x005f0000, 0x005c0000, 0x00030000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x005c0000, 0x00020000,
|
||||
0x00050000, 0x00040000, 0xffff0000, 0x0000ffff, 0x00010000, 0x000c0000, 0x73730000, 0x63694d00,
|
||||
0x6f736f72, 0x28207466, 0x48202952, 0x204c534c, 0x64616853, 0x43207265, 0x69706d6f, 0x2072656c,
|
||||
0x312e3031, 0x5349ab00, 0x00084e47, 0x00000000, 0x00080000, 0x534f0000, 0x002c4e47, 0x00010000,
|
||||
0x00080000, 0x00200000, 0x00000000, 0x00000000, 0x00030000, 0x00000000, 0x000f0000, 0x56530000,
|
||||
0x7261545f, 0x00746567, 0x4853abab, 0x00645244, 0x00400000, 0x00190000, 0x005a0000, 0x60000300,
|
||||
0x00000010, 0x18580000, 0x70000400, 0x00000010, 0x55550000, 0x00650000, 0x20f20300, 0x00000010,
|
||||
0x00450000, 0x20f20c00, 0x00000010, 0x40020000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x7e460000, 0x00000010, 0x60000000, 0x00000010, 0x003e0000, 0x54530100, 0x00745441, 0x00020000,
|
||||
0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x07260000, 0x00000000, 0x00300000, 0x00140000,
|
||||
0x00000000, 0xffff0000, 0x000affff, 0x000c0000, 0x00000000, 0x00010000, 0x003b0000, 0x000d0000,
|
||||
0x00000000, 0x00010000, 0x00470000, 0x000e0000, 0x00000000, 0x00010000, 0x00530000, 0x000f0000,
|
||||
0x00000000, 0x00010000, 0x005f0000, 0x00100000, 0x00000000, 0x00010000, 0x006b0000, 0x00110000,
|
||||
0x00000000, 0x00010000, 0x00770000, 0x00120000, 0x00000000, 0x00010000, 0x00830000, 0x00130000,
|
||||
0x00000000, 0x00010000, 0x008f0000, 0x00140000, 0x00000000, 0x00010000, 0x009b0000, 0x00150000,
|
||||
0x00000000, 0x00010000, 0x00a70000, 0x00000000, 0x00e10000, 0x00c50000, 0x00000000, 0xffff0000,
|
||||
0x000effff, 0x00160000, 0x00000000, 0x00010000, 0x00ea0000, 0x00170000, 0x00000000, 0x00010000,
|
||||
0x00f60000, 0x00180000, 0x00000000, 0x00010000, 0x01020000, 0x00190000, 0x00000000, 0x00010000,
|
||||
0x010e0000, 0x001a0000, 0x00000000, 0x00010000, 0x011a0000, 0x001b0000, 0x00000000, 0x00010000,
|
||||
0x01260000, 0x001c0000, 0x00000000, 0x00010000, 0x01320000, 0x001d0000, 0x00000000, 0x00010000,
|
||||
0x013e0000, 0x001e0000, 0x00000000, 0x00010000, 0x014a0000, 0x001f0000, 0x00000000, 0x00010000,
|
||||
0x01560000, 0x00200000, 0x00000000, 0x00010000, 0x01620000, 0x00210000, 0x00000000, 0x00010000,
|
||||
0x016e0000, 0x00220000, 0x00000000, 0x00010000, 0x017a0000, 0x00230000, 0x00000000, 0x00010000,
|
||||
0x01860000, 0x00000000, 0x01b90000, 0x019d0000, 0x00000000, 0xffff0000, 0x000bffff, 0x00240000,
|
||||
0x00000000, 0x00010000, 0x01c50000, 0x00250000, 0x00000000, 0x00010000, 0x01d10000, 0x00250000,
|
||||
0x00070000, 0x00010000, 0x01dd0000, 0x00260000, 0x00000000, 0x00010000, 0x01e90000, 0x00270000,
|
||||
0x00000000, 0x00010000, 0x01f50000, 0x00280000, 0x00000000, 0x00010000, 0x02010000, 0x00290000,
|
||||
0x00000000, 0x00010000, 0x020d0000, 0x002a0000, 0x00000000, 0x00010000, 0x02190000, 0x002b0000,
|
||||
0x00000000, 0x00010000, 0x02250000, 0x002c0000, 0x00000000, 0x00010000, 0x02310000, 0x002c0000,
|
||||
0x00070000, 0x00010000, 0x023d0000, 0x00000000, 0x02720000, 0x02560000, 0x00000000, 0xffff0000,
|
||||
0x000bffff, 0x002d0000, 0x00000000, 0x00010000, 0x027b0000, 0x002e0000, 0x00000000, 0x00010000,
|
||||
0x02870000, 0x002f0000, 0x00000000, 0x00010000, 0x02930000, 0x00300000, 0x00000000, 0x00010000,
|
||||
0x029f0000, 0x00310000, 0x00000000, 0x00010000, 0x02ab0000, 0x00320000, 0x00000000, 0x00010000,
|
||||
0x02b70000, 0x00330000, 0x00000000, 0x00010000, 0x02c30000, 0x00340000, 0x00000000, 0x00010000,
|
||||
0x02cf0000, 0x00350000, 0x00000000, 0x00010000, 0x02f30000, 0x00360000, 0x00000000, 0x00010000,
|
||||
0x02ff0000, 0x00370000, 0x00000000, 0x00010000, 0x030b0000, 0x00000000, 0x033b0000, 0x031f0000,
|
||||
0x00000000, 0xffff0000, 0x0000ffff, 0x03640000, 0x03480000, 0x00000000, 0xffff0000, 0x0000ffff,
|
||||
0x03920000, 0x03760000, 0x00000000, 0xffff0000, 0x0000ffff, 0x03bc0000, 0x03a00000, 0x00000000,
|
||||
0xffff0000, 0x0000ffff, 0x03ea0000, 0x03ce0000, 0x00000000, 0xffff0000, 0x0000ffff, 0x04160000,
|
||||
0x03fa0000, 0x00000000, 0xffff0000, 0x0000ffff, 0x04490000, 0x042d0000, 0x00000000, 0xffff0000,
|
||||
0x0000ffff, 0x04760000, 0x045a0000, 0x00000000, 0xffff0000, 0x0000ffff, 0x04a10000, 0x04850000,
|
||||
0x00000000, 0xffff0000, 0x0000ffff, 0x04a40000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff,
|
||||
0x00370000, 0x00000000, 0x00020000, 0x033b0000, 0x00000000, 0x04ad0000, 0x02560000, 0x00000000,
|
||||
0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, 0x00020000, 0x03640000, 0x00000000, 0x04b60000,
|
||||
0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, 0x00020000, 0x03920000,
|
||||
0x00000000, 0x04c00000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000,
|
||||
0x00020000, 0x03bc0000, 0x00000000, 0x04c90000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff,
|
||||
0x00370000, 0x00000000, 0x00020000, 0x03ea0000, 0x00000000, 0x04d30000, 0x02560000, 0x00000000,
|
||||
0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, 0x00020000, 0x04160000, 0x00000000, 0x04dc0000,
|
||||
0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, 0x00020000, 0x04490000,
|
||||
0x00000000, 0x04e60000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000,
|
||||
0x00020000, 0x04760000, 0x00000000, 0x04ef0000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff,
|
||||
0x00370000, 0x00000000, 0x00020000, 0x04a10000, 0x00000000, 0x05140000, 0x04f80000, 0x00000000,
|
||||
0xffff0000, 0x0000ffff, 0x05350000, 0x05190000, 0x00000000, 0xffff0000, 0x0000ffff, 0x05560000,
|
||||
0x053a0000, 0x00000000, 0xffff0000, 0x0000ffff, 0x05780000, 0x055c0000, 0x00000000, 0xffff0000,
|
||||
0x0000ffff, 0x05990000, 0x057d0000, 0x00000000, 0xffff0000, 0x0000ffff, 0x05bb0000, 0x059f0000,
|
||||
0x00000000, 0xffff0000, 0x0000ffff, 0x05df0000, 0x05c30000, 0x00000000, 0xffff0000, 0x0000ffff,
|
||||
0x06040000, 0x05e80000, 0x00000000, 0xffff0000, 0x0000ffff, 0x06250000, 0x06090000, 0x00000000,
|
||||
0xffff0000, 0x0000ffff, 0x062a0000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000,
|
||||
0x00000000, 0x00030000, 0x06330000, 0x00000000, 0x063b0000, 0x02560000, 0x00000000, 0xffff0000,
|
||||
0x0001ffff, 0x00370000, 0x00000000, 0x00030000, 0x06440000, 0x00000000, 0x064c0000, 0x02560000,
|
||||
0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, 0x00030000, 0x06550000, 0x00000000,
|
||||
0x065d0000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, 0x00030000,
|
||||
0x06670000, 0x00000000, 0x066f0000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000,
|
||||
0x00000000, 0x00030000, 0x06790000, 0x00000000, 0x06810000, 0x02560000, 0x00000000, 0xffff0000,
|
||||
0x0001ffff, 0x00370000, 0x00000000, 0x00030000, 0x068b0000, 0x00000000, 0x06930000, 0x02560000,
|
||||
0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, 0x00030000, 0x069d0000, 0x00000000,
|
||||
0x06a50000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000, 0x00000000, 0x00030000,
|
||||
0x06af0000, 0x00000000, 0x06b70000, 0x02560000, 0x00000000, 0xffff0000, 0x0001ffff, 0x00370000,
|
||||
0x00000000, 0x00030000, 0x06c10000, 0x00000000, 0x06c90000, 0x02560000, 0x00000000, 0xffff0000,
|
||||
0x0001ffff, 0x00370000, 0x00000000, 0x00010000, 0x06cc0000, 0x00000000, 0x06d80000, 0x00020000,
|
||||
0x00000000, 0x06de0000, 0x00060000, 0x00000000, 0x000a0000, 0x00000000, 0x00010000, 0x06e40000,
|
||||
0x000b0000, 0x00000000, 0x00010000, 0x07080000, 0x00020000, 0x00000000, 0x00020000, 0x01b90000,
|
||||
0x00090000, 0x00000000, 0x00010000, 0x07140000, 0x00010000, 0x00000000, 0x00020000, 0x00e10000,
|
||||
0x00000000, 0x00000000, 0x00020000, 0x00300000, 0x07200000, 0x00010000, 0x00000000, 0x00070000,
|
||||
0x00000000, 0x00070000, 0x091a0000, 0x00000000,
|
||||
};
|
||||
|
||||
static void create_effect_texture_resource(ID3D10Device *device, ID3D10ShaderResourceView **srv,
|
||||
ID3D10Texture2D **tex)
|
||||
{
|
||||
D3D10_TEXTURE2D_DESC tex_desc;
|
||||
HRESULT hr;
|
||||
|
||||
tex_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
tex_desc.Width = 8;
|
||||
tex_desc.Height = 8;
|
||||
tex_desc.ArraySize = 1;
|
||||
tex_desc.MipLevels = 0;
|
||||
tex_desc.BindFlags = D3D10_BIND_SHADER_RESOURCE;
|
||||
tex_desc.Usage = D3D10_USAGE_DEFAULT;
|
||||
tex_desc.CPUAccessFlags = 0;
|
||||
tex_desc.SampleDesc.Count = 1;
|
||||
tex_desc.SampleDesc.Quality = 0;
|
||||
tex_desc.MiscFlags = 0;
|
||||
|
||||
hr = ID3D10Device_CreateTexture2D(device, &tex_desc, NULL, tex);
|
||||
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = ID3D10Device_CreateShaderResourceView(device, (ID3D10Resource *)*tex, NULL, srv);
|
||||
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
}
|
||||
|
||||
static void test_effect_state_groups(void)
|
||||
{
|
||||
ID3D10ShaderResourceView *srv0, *srv1;
|
||||
ID3D10EffectDepthStencilVariable *d;
|
||||
ID3D10EffectRasterizerVariable *r;
|
||||
ID3D10DepthStencilState *ds_state;
|
||||
|
@ -4325,6 +4380,7 @@ static void test_effect_state_groups(void)
|
|||
ID3D10EffectVariable *v;
|
||||
ID3D10EffectPass *pass;
|
||||
float blend_factor[4];
|
||||
ID3D10Texture2D *tex0;
|
||||
ID3D10Effect *effect;
|
||||
ID3D10Device *device;
|
||||
ULONG refcount;
|
||||
|
@ -4347,7 +4403,7 @@ static void test_effect_state_groups(void)
|
|||
effect_desc.ConstantBuffers);
|
||||
ok(effect_desc.SharedConstantBuffers == 0, "Unexpected shared constant buffers count %u.\n",
|
||||
effect_desc.SharedConstantBuffers);
|
||||
ok(effect_desc.GlobalVariables == 40, "Unexpected global variables count %u.\n",
|
||||
ok(effect_desc.GlobalVariables == 41, "Unexpected global variables count %u.\n",
|
||||
effect_desc.GlobalVariables);
|
||||
ok(effect_desc.SharedGlobalVariables == 0, "Unexpected shared global variables count %u.\n",
|
||||
effect_desc.SharedGlobalVariables);
|
||||
|
@ -4535,6 +4591,29 @@ static void test_effect_state_groups(void)
|
|||
ID3D10RasterizerState_Release(rast_state);
|
||||
ID3D10DepthStencilState_Release(ds_state);
|
||||
ID3D10BlendState_Release(blend_state);
|
||||
|
||||
/* pass 1 - uses SamplerState.Texture = NULL, resource slot is reset. */
|
||||
pass = technique->lpVtbl->GetPassByName(technique, "pass1");
|
||||
ok(pass->lpVtbl->IsValid(pass), "Failed to get pass.\n");
|
||||
|
||||
create_effect_texture_resource(device, &srv0, &tex0);
|
||||
|
||||
hr = D3D10StateBlockMaskDisableAll(&mask);
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
hr = pass->lpVtbl->ComputeStateBlockMask(pass, &mask);
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
ret = D3D10StateBlockMaskGetSetting(&mask, D3D10_DST_VS_SHADER_RESOURCES, 0);
|
||||
ok(!ret, "Unexpected mask.\n");
|
||||
|
||||
ID3D10Device_PSSetShaderResources(device, 0, 1, &srv0);
|
||||
hr = pass->lpVtbl->Apply(pass, 0);
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
ID3D10Device_PSGetShaderResources(device, 0, 1, &srv1);
|
||||
ok(!srv1, "Unexpected resource pointer.\n");
|
||||
|
||||
ID3D10ShaderResourceView_Release(srv0);
|
||||
ID3D10Texture2D_Release(tex0);
|
||||
|
||||
effect->lpVtbl->Release(effect);
|
||||
|
||||
refcount = ID3D10Device_Release(device);
|
||||
|
@ -5989,30 +6068,6 @@ static DWORD fx_test_resource_variable2[] =
|
|||
0x0002aa00, 0x00000100, 0x00000000, 0x00000700, 0x00000000, 0x00000300, 0x0002ad00, 0x00000000,
|
||||
};
|
||||
|
||||
static void create_effect_texture_resource(ID3D10Device *device, ID3D10ShaderResourceView **srv,
|
||||
ID3D10Texture2D **tex)
|
||||
{
|
||||
D3D10_TEXTURE2D_DESC tex_desc;
|
||||
HRESULT hr;
|
||||
|
||||
tex_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
tex_desc.Width = 8;
|
||||
tex_desc.Height = 8;
|
||||
tex_desc.ArraySize = 1;
|
||||
tex_desc.MipLevels = 0;
|
||||
tex_desc.BindFlags = D3D10_BIND_SHADER_RESOURCE;
|
||||
tex_desc.Usage = D3D10_USAGE_DEFAULT;
|
||||
tex_desc.CPUAccessFlags = 0;
|
||||
tex_desc.SampleDesc.Count = 1;
|
||||
tex_desc.SampleDesc.Quality = 0;
|
||||
tex_desc.MiscFlags = 0;
|
||||
|
||||
hr = ID3D10Device_CreateTexture2D(device, &tex_desc, NULL, tex);
|
||||
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
hr = ID3D10Device_CreateShaderResourceView(device, (ID3D10Resource *)*tex, NULL, srv);
|
||||
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
|
||||
}
|
||||
|
||||
#define get_effect_shader_resource_variable(a) get_effect_shader_resource_variable_(__LINE__, a)
|
||||
static ID3D10EffectShaderResourceVariable *get_effect_shader_resource_variable_(unsigned int line,
|
||||
ID3D10EffectVariable *var)
|
||||
|
|
Loading…
Reference in New Issue