From: Elizabeth Figura zfigura@codeweavers.com
--- dlls/wined3d/cs.c | 35 -------------------------- dlls/wined3d/stateblock.c | 46 ---------------------------------- dlls/wined3d/wined3d_private.h | 3 --- 3 files changed, 84 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 24852762a6a..83c74c56ed0 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -118,7 +118,6 @@ enum wined3d_cs_op WINED3D_CS_OP_SET_DEPTH_BOUNDS, WINED3D_CS_OP_SET_RENDER_STATE, WINED3D_CS_OP_SET_TEXTURE_STATE, - WINED3D_CS_OP_SET_TRANSFORM, WINED3D_CS_OP_SET_COLOR_KEY, WINED3D_CS_OP_SET_LIGHT, WINED3D_CS_OP_SET_LIGHT_ENABLE, @@ -380,13 +379,6 @@ struct wined3d_cs_set_texture_state DWORD value; };
-struct wined3d_cs_set_transform -{ - enum wined3d_cs_op opcode; - enum wined3d_transform_state state; - struct wined3d_matrix matrix; -}; - struct wined3d_cs_set_light { enum wined3d_cs_op opcode; @@ -619,7 +611,6 @@ static const char *debug_cs_op(enum wined3d_cs_op op) WINED3D_TO_STR(WINED3D_CS_OP_SET_DEPTH_BOUNDS); WINED3D_TO_STR(WINED3D_CS_OP_SET_RENDER_STATE); WINED3D_TO_STR(WINED3D_CS_OP_SET_TEXTURE_STATE); - WINED3D_TO_STR(WINED3D_CS_OP_SET_TRANSFORM); WINED3D_TO_STR(WINED3D_CS_OP_SET_COLOR_KEY); WINED3D_TO_STR(WINED3D_CS_OP_SET_LIGHT); WINED3D_TO_STR(WINED3D_CS_OP_SET_LIGHT_ENABLE); @@ -1942,31 +1933,6 @@ void wined3d_device_context_emit_set_texture_state(struct wined3d_device_context wined3d_device_context_submit(context, WINED3D_CS_QUEUE_DEFAULT); }
-static void wined3d_cs_exec_set_transform(struct wined3d_cs *cs, const void *data) -{ - const struct wined3d_cs_set_transform *op = data; - - cs->state.transforms[op->state] = op->matrix; - /* Fog behaviour depends on the projection matrix. */ - if (op->state == WINED3D_TS_PROJECTION - && cs->state.render_states[WINED3D_RS_FOGENABLE] - && cs->state.extra_vs_args.pixel_fog) - device_invalidate_state(cs->c.device, STATE_SHADER(WINED3D_SHADER_TYPE_VERTEX)); -} - -void wined3d_device_context_emit_set_transform(struct wined3d_device_context *context, - enum wined3d_transform_state state, const struct wined3d_matrix *matrix) -{ - struct wined3d_cs_set_transform *op; - - op = wined3d_device_context_require_space(context, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT); - op->opcode = WINED3D_CS_OP_SET_TRANSFORM; - op->state = state; - op->matrix = *matrix; - - wined3d_device_context_submit(context, WINED3D_CS_QUEUE_DEFAULT); -} - static void wined3d_cs_exec_set_color_key(struct wined3d_cs *cs, const void *data) { const struct wined3d_cs_set_color_key *op = data; @@ -3060,7 +3026,6 @@ static void (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void /* WINED3D_CS_OP_SET_DEPTH_BOUNDS */ wined3d_cs_exec_set_depth_bounds, /* WINED3D_CS_OP_SET_RENDER_STATE */ wined3d_cs_exec_set_render_state, /* WINED3D_CS_OP_SET_TEXTURE_STATE */ wined3d_cs_exec_set_texture_state, - /* WINED3D_CS_OP_SET_TRANSFORM */ wined3d_cs_exec_set_transform, /* WINED3D_CS_OP_SET_COLOR_KEY */ wined3d_cs_exec_set_color_key, /* WINED3D_CS_OP_SET_LIGHT */ wined3d_cs_exec_set_light, /* WINED3D_CS_OP_SET_LIGHT_ENABLE */ wined3d_cs_exec_set_light_enable, diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 97e865a4926..f4122a968be 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -2327,21 +2327,12 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d state->primitive_type = WINED3D_PT_UNDEFINED; state->patch_vertex_count = 0;
- /* Set some of the defaults for lights, transforms etc */ - state->transforms[WINED3D_TS_PROJECTION] = identity; - state->transforms[WINED3D_TS_VIEW] = identity; - for (i = 0; i < 256; ++i) - { - state->transforms[WINED3D_TS_WORLD_MATRIX(i)] = identity; - } - init_default_render_states(state->render_states, d3d_info);
/* Texture Stage States - Put directly into state block, we will call function below */ for (i = 0; i < WINED3D_MAX_FFP_TEXTURES; ++i) { TRACE("Setting up default texture states for texture Stage %u.\n", i); - state->transforms[WINED3D_TS_TEXTURE0 + i] = identity; init_default_texture_state(i, state->texture_states[i]); }
@@ -2837,31 +2828,6 @@ static void wined3d_device_set_texture(struct wined3d_device *device, return; }
-static void wined3d_device_set_transform(struct wined3d_device *device, - enum wined3d_transform_state state, const struct wined3d_matrix *matrix) -{ - TRACE("device %p, state %s, matrix %p.\n", device, debug_d3dtstype(state), matrix); - TRACE("%.8e %.8e %.8e %.8e\n", matrix->_11, matrix->_12, matrix->_13, matrix->_14); - TRACE("%.8e %.8e %.8e %.8e\n", matrix->_21, matrix->_22, matrix->_23, matrix->_24); - TRACE("%.8e %.8e %.8e %.8e\n", matrix->_31, matrix->_32, matrix->_33, matrix->_34); - TRACE("%.8e %.8e %.8e %.8e\n", matrix->_41, matrix->_42, matrix->_43, matrix->_44); - - /* If the new matrix is the same as the current one, - * we cut off any further processing. this seems to be a reasonable - * optimization because as was noticed, some apps (warcraft3 for example) - * tend towards setting the same matrix repeatedly for some reason. - * - * From here on we assume that the new matrix is different, wherever it matters. */ - if (!memcmp(&device->cs->c.state->transforms[state], matrix, sizeof(*matrix))) - { - TRACE("The application is setting the same matrix over again.\n"); - return; - } - - device->cs->c.state->transforms[state] = *matrix; - wined3d_device_context_emit_set_transform(&device->cs->c, state, matrix); -} - static enum wined3d_texture_address get_texture_address_mode(const struct wined3d_texture *texture, enum wined3d_texture_address t) { @@ -3688,13 +3654,6 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, wined3d_device_context_push_constants(context, WINED3D_PUSH_CONSTANTS_VS_FFP, WINED3D_SHADER_CONST_FFP_PROJ, offsetof(struct wined3d_ffp_vs_constants, projection_matrix), sizeof(matrix), &matrix); } - - if (wined3d_bitmap_is_set(changed->transform, WINED3D_TS_PROJECTION)) - { - /* wined3d_ffp_vs_settings.ortho_fog still needs the - * device state to be set. */ - wined3d_device_set_transform(device, WINED3D_TS_PROJECTION, &state->transforms[WINED3D_TS_PROJECTION]); - } } else if (changed->transforms) { @@ -3705,15 +3664,10 @@ void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, }
if (wined3d_bitmap_is_set(changed->transform, WINED3D_TS_PROJECTION) || changed->position_transformed) - { wined3d_device_context_push_constants(context, WINED3D_PUSH_CONSTANTS_VS_FFP, WINED3D_SHADER_CONST_FFP_PROJ, offsetof(struct wined3d_ffp_vs_constants, projection_matrix), sizeof(state->transforms[WINED3D_TS_PROJECTION]), &state->transforms[WINED3D_TS_PROJECTION]); - /* wined3d_ffp_vs_settings.ortho_fog and vs_compile_args.ortho_fog - * still need the device state to be set. */ - wined3d_device_set_transform(device, WINED3D_TS_PROJECTION, &state->transforms[WINED3D_TS_PROJECTION]); - }
/* Clip planes are affected by the view matrix. */ changed->clipplane = wined3d_mask_from_size(WINED3D_MAX_CLIP_DISTANCES); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index f0dd1884838..5e74a216c5c 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2980,7 +2980,6 @@ struct wined3d_state
uint32_t texture_states[WINED3D_MAX_FFP_TEXTURES][WINED3D_HIGHEST_TEXTURE_STATE + 1];
- struct wined3d_matrix transforms[WINED3D_HIGHEST_TRANSFORM_STATE + 1]; struct wined3d_viewport viewports[WINED3D_MAX_VIEWPORTS]; unsigned int viewport_count; RECT scissor_rects[WINED3D_MAX_VIEWPORTS]; @@ -3821,8 +3820,6 @@ void wined3d_device_context_emit_set_texture(struct wined3d_device_context *cont struct wined3d_shader_resource_view *view); void wined3d_device_context_emit_set_texture_state(struct wined3d_device_context *context, unsigned int stage, enum wined3d_texture_stage_state state, unsigned int value); -void wined3d_device_context_emit_set_transform(struct wined3d_device_context *context, - enum wined3d_transform_state state, const struct wined3d_matrix *matrix); void wined3d_device_context_emit_set_unordered_access_views(struct wined3d_device_context *context, enum wined3d_pipeline pipeline, unsigned int start_idx, unsigned int count, struct wined3d_unordered_access_view *const *views, const unsigned int *initial_count);