wined3d: Introduce WINED3D_BITMAP_SIZE.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2020-05-13 01:12:55 +04:30 committed by Alexandre Julliard
parent 149d7b31f5
commit 552b335ae8
1 changed files with 8 additions and 6 deletions

View File

@ -80,6 +80,8 @@
#define WINED3D_ALPHA_TO_COVERAGE_ENABLE MAKEFOURCC('A','2','M','1')
#define WINED3D_ALPHA_TO_COVERAGE_DISABLE MAKEFOURCC('A','2','M','0')
#define WINED3D_BITMAP_SIZE(x) (((x) + 31) >> 5)
struct wined3d_fragment_pipe_ops;
struct wined3d_adapter;
struct wined3d_context;
@ -1969,8 +1971,8 @@ struct wined3d_context
{
const struct wined3d_d3d_info *d3d_info;
const struct wined3d_state_entry *state_table;
uint32_t dirty_graphics_states[STATE_HIGHEST / (sizeof(uint32_t) * CHAR_BIT) + 1];
uint32_t dirty_compute_states[STATE_COMPUTE_COUNT / (sizeof(uint32_t) * CHAR_BIT) + 1];
uint32_t dirty_graphics_states[WINED3D_BITMAP_SIZE(STATE_HIGHEST)];
uint32_t dirty_compute_states[WINED3D_BITMAP_SIZE(STATE_COMPUTE_COUNT)];
struct wined3d_device *device;
struct wined3d_swapchain *swapchain;
@ -4164,16 +4166,16 @@ struct wined3d_vertex_declaration
struct wined3d_saved_states
{
DWORD vs_consts_f[WINED3D_MAX_VS_CONSTS_F >> 5];
uint32_t vs_consts_f[WINED3D_BITMAP_SIZE(WINED3D_MAX_VS_CONSTS_F)];
WORD vertexShaderConstantsI; /* WINED3D_MAX_CONSTS_I, 16 */
WORD vertexShaderConstantsB; /* WINED3D_MAX_CONSTS_B, 16 */
DWORD ps_consts_f[WINED3D_MAX_PS_CONSTS_F >> 5];
uint32_t ps_consts_f[WINED3D_BITMAP_SIZE(WINED3D_MAX_PS_CONSTS_F)];
WORD pixelShaderConstantsI; /* WINED3D_MAX_CONSTS_I, 16 */
WORD pixelShaderConstantsB; /* WINED3D_MAX_CONSTS_B, 16 */
DWORD transform[(WINED3D_HIGHEST_TRANSFORM_STATE >> 5) + 1];
uint32_t transform[WINED3D_BITMAP_SIZE(WINED3D_HIGHEST_TRANSFORM_STATE + 1)];
WORD streamSource; /* WINED3D_MAX_STREAMS, 16 */
WORD streamFreq; /* WINED3D_MAX_STREAMS, 16 */
DWORD renderState[(WINEHIGHEST_RENDER_STATE >> 5) + 1];
uint32_t renderState[WINED3D_BITMAP_SIZE(WINEHIGHEST_RENDER_STATE + 1)];
DWORD textureState[WINED3D_MAX_TEXTURES]; /* WINED3D_HIGHEST_TEXTURE_STATE + 1, 18 */
WORD samplerState[WINED3D_MAX_COMBINED_SAMPLERS]; /* WINED3D_HIGHEST_SAMPLER_STATE + 1, 14 */
DWORD clipplane; /* WINED3D_MAX_CLIP_DISTANCES, 8 */