Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
380f989c
Commit
380f989c
authored
Nov 16, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 17, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10: Implement D3D10StateBlockMaskGetSetting().
parent
c7feb3a5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
108 additions
and
1 deletion
+108
-1
d3d10.spec
dlls/d3d10/d3d10.spec
+1
-1
stateblock.c
dlls/d3d10/stateblock.c
+83
-0
device.c
dlls/d3d10/tests/device.c
+22
-0
d3d10effect.h
include/d3d10effect.h
+2
-0
No files found.
dlls/d3d10/d3d10.spec
View file @
380f989c
...
...
@@ -24,6 +24,6 @@
@ stdcall D3D10StateBlockMaskDisableCapture(ptr long long long)
@ stdcall D3D10StateBlockMaskEnableAll(ptr)
@ stdcall D3D10StateBlockMaskEnableCapture(ptr long long long)
@ st
ub D3D10StateBlockMaskGetSetting
@ st
dcall D3D10StateBlockMaskGetSetting(ptr long long)
@ stub D3D10StateBlockMaskIntersect
@ stub D3D10StateBlockMaskUnion
dlls/d3d10/stateblock.c
View file @
380f989c
...
...
@@ -144,6 +144,14 @@ HRESULT WINAPI D3D10CreateStateBlock(ID3D10Device *device,
return
S_OK
;
}
static
BOOL
stateblock_mask_get_bit
(
BYTE
*
field
,
UINT
field_size
,
UINT
idx
)
{
if
(
idx
>=
field_size
)
return
FALSE
;
return
field
[
idx
>>
3
]
&
(
1
<<
(
idx
&
7
));
}
static
HRESULT
stateblock_mask_set_bits
(
BYTE
*
field
,
UINT
field_size
,
UINT
start_bit
,
UINT
count
)
{
UINT
end_bit
=
start_bit
+
count
;
...
...
@@ -402,3 +410,78 @@ HRESULT WINAPI D3D10StateBlockMaskEnableCapture(D3D10_STATE_BLOCK_MASK *mask,
return
E_INVALIDARG
;
}
}
BOOL
WINAPI
D3D10StateBlockMaskGetSetting
(
D3D10_STATE_BLOCK_MASK
*
mask
,
D3D10_DEVICE_STATE_TYPES
state_type
,
UINT
idx
)
{
TRACE
(
"mask %p state_type %s, idx %u.
\n
"
,
mask
,
debug_d3d10_device_state_types
(
state_type
),
idx
);
if
(
!
mask
)
return
FALSE
;
switch
(
state_type
)
{
case
D3D10_DST_SO_BUFFERS
:
return
stateblock_mask_get_bit
(
&
mask
->
SOBuffers
,
1
,
idx
);
case
D3D10_DST_OM_RENDER_TARGETS
:
return
stateblock_mask_get_bit
(
&
mask
->
OMRenderTargets
,
1
,
idx
);
case
D3D10_DST_DEPTH_STENCIL_STATE
:
return
stateblock_mask_get_bit
(
&
mask
->
OMDepthStencilState
,
1
,
idx
);
case
D3D10_DST_BLEND_STATE
:
return
stateblock_mask_get_bit
(
&
mask
->
OMBlendState
,
1
,
idx
);
case
D3D10_DST_VS
:
return
stateblock_mask_get_bit
(
&
mask
->
VS
,
1
,
idx
);
case
D3D10_DST_VS_SAMPLERS
:
return
stateblock_mask_get_bit
(
mask
->
VSSamplers
,
D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT
,
idx
);
case
D3D10_DST_VS_SHADER_RESOURCES
:
return
stateblock_mask_get_bit
(
mask
->
VSShaderResources
,
D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT
,
idx
);
case
D3D10_DST_VS_CONSTANT_BUFFERS
:
return
stateblock_mask_get_bit
(
mask
->
VSConstantBuffers
,
D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT
,
idx
);
case
D3D10_DST_GS
:
return
stateblock_mask_get_bit
(
&
mask
->
GS
,
1
,
idx
);
case
D3D10_DST_GS_SAMPLERS
:
return
stateblock_mask_get_bit
(
mask
->
GSSamplers
,
D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT
,
idx
);
case
D3D10_DST_GS_SHADER_RESOURCES
:
return
stateblock_mask_get_bit
(
mask
->
GSShaderResources
,
D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT
,
idx
);
case
D3D10_DST_GS_CONSTANT_BUFFERS
:
return
stateblock_mask_get_bit
(
mask
->
GSConstantBuffers
,
D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT
,
idx
);
case
D3D10_DST_PS
:
return
stateblock_mask_get_bit
(
&
mask
->
PS
,
1
,
idx
);
case
D3D10_DST_PS_SAMPLERS
:
return
stateblock_mask_get_bit
(
mask
->
PSSamplers
,
D3D10_COMMONSHADER_SAMPLER_SLOT_COUNT
,
idx
);
case
D3D10_DST_PS_SHADER_RESOURCES
:
return
stateblock_mask_get_bit
(
mask
->
PSShaderResources
,
D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT
,
idx
);
case
D3D10_DST_PS_CONSTANT_BUFFERS
:
return
stateblock_mask_get_bit
(
mask
->
PSConstantBuffers
,
D3D10_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT
,
idx
);
case
D3D10_DST_IA_VERTEX_BUFFERS
:
return
stateblock_mask_get_bit
(
mask
->
IAVertexBuffers
,
D3D10_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT
,
idx
);
case
D3D10_DST_IA_INDEX_BUFFER
:
return
stateblock_mask_get_bit
(
&
mask
->
IAIndexBuffer
,
1
,
idx
);
case
D3D10_DST_IA_INPUT_LAYOUT
:
return
stateblock_mask_get_bit
(
&
mask
->
IAInputLayout
,
1
,
idx
);
case
D3D10_DST_IA_PRIMITIVE_TOPOLOGY
:
return
stateblock_mask_get_bit
(
&
mask
->
IAPrimitiveTopology
,
1
,
idx
);
case
D3D10_DST_RS_VIEWPORTS
:
return
stateblock_mask_get_bit
(
&
mask
->
RSViewports
,
1
,
idx
);
case
D3D10_DST_RS_SCISSOR_RECTS
:
return
stateblock_mask_get_bit
(
&
mask
->
RSScissorRects
,
1
,
idx
);
case
D3D10_DST_RS_RASTERIZER_STATE
:
return
stateblock_mask_get_bit
(
&
mask
->
RSRasterizerState
,
1
,
idx
);
case
D3D10_DST_PREDICATION
:
return
stateblock_mask_get_bit
(
&
mask
->
Predication
,
1
,
idx
);
default:
FIXME
(
"Unhandled state_type %#x.
\n
"
,
state_type
);
return
FALSE
;
}
}
dlls/d3d10/tests/device.c
View file @
380f989c
...
...
@@ -94,6 +94,7 @@ static void test_stateblock_mask(void)
};
D3D10_STATE_BLOCK_MASK
mask_x
,
mask_y
,
result
;
HRESULT
hr
;
BOOL
ret
;
UINT
i
;
memset
(
&
mask_x
,
0
,
sizeof
(
mask_x
));
...
...
@@ -176,6 +177,27 @@ static void test_stateblock_mask(void)
result
.
VSShaderResources
[
2
],
result
.
VSShaderResources
[
3
],
result
.
VSShaderResources
[
4
],
i
);
}
result
.
VS
=
0xff
;
ret
=
D3D10StateBlockMaskGetSetting
(
&
result
,
D3D10_DST_VS
,
0
);
ok
(
ret
==
1
,
"Got unexpected ret %#x.
\n
"
,
ret
);
ret
=
D3D10StateBlockMaskGetSetting
(
&
result
,
D3D10_DST_VS
,
1
);
ok
(
!
ret
,
"Got unexpected ret %#x.
\n
"
,
ret
);
result
.
VS
=
0xfe
;
ret
=
D3D10StateBlockMaskGetSetting
(
&
result
,
D3D10_DST_VS
,
0
);
ok
(
!
ret
,
"Got unexpected ret %#x.
\n
"
,
ret
);
result
.
VS
=
0
;
ret
=
D3D10StateBlockMaskGetSetting
(
&
result
,
D3D10_DST_VS
,
0
);
ok
(
!
ret
,
"Got unexpected ret %#x.
\n
"
,
ret
);
memset
(
&
result
,
0xff
,
sizeof
(
result
));
ret
=
D3D10StateBlockMaskGetSetting
(
&
result
,
D3D10_DST_VS_SHADER_RESOURCES
,
3
);
ok
(
ret
==
8
,
"Got unexpected ret %#x.
\n
"
,
ret
);
ret
=
D3D10StateBlockMaskGetSetting
(
&
result
,
D3D10_DST_VS_SHADER_RESOURCES
,
D3D10_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT
);
ok
(
!
ret
,
"Got unexpected ret %#x.
\n
"
,
ret
);
memset
(
&
result
,
0
,
sizeof
(
result
));
ret
=
D3D10StateBlockMaskGetSetting
(
&
result
,
D3D10_DST_VS_SHADER_RESOURCES
,
3
);
ok
(
!
ret
,
"Got unexpected ret %#x.
\n
"
,
ret
);
}
START_TEST
(
device
)
...
...
include/d3d10effect.h
View file @
380f989c
...
...
@@ -840,6 +840,8 @@ HRESULT WINAPI D3D10StateBlockMaskDisableCapture(D3D10_STATE_BLOCK_MASK *mask,
HRESULT
WINAPI
D3D10StateBlockMaskEnableAll
(
D3D10_STATE_BLOCK_MASK
*
mask
);
HRESULT
WINAPI
D3D10StateBlockMaskEnableCapture
(
D3D10_STATE_BLOCK_MASK
*
mask
,
D3D10_DEVICE_STATE_TYPES
state_type
,
UINT
start_idx
,
UINT
count
);
BOOL
WINAPI
D3D10StateBlockMaskGetSetting
(
D3D10_STATE_BLOCK_MASK
*
mask
,
D3D10_DEVICE_STATE_TYPES
state_type
,
UINT
idx
);
#ifdef __cplusplus
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment