wined3d: Rename WineD3DContext to struct wined3d_context.
This commit is contained in:
parent
1d647283d5
commit
da1e5573da
|
@ -534,7 +534,7 @@ static void shader_arb_load_constants(
|
||||||
|
|
||||||
IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) device;
|
IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) device;
|
||||||
IWineD3DStateBlockImpl* stateBlock = deviceImpl->stateBlock;
|
IWineD3DStateBlockImpl* stateBlock = deviceImpl->stateBlock;
|
||||||
const struct WineD3DContext *context = context_get_current();
|
const struct wined3d_context *context = context_get_current();
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||||
|
|
||||||
if (useVertexShader) {
|
if (useVertexShader) {
|
||||||
|
@ -560,7 +560,7 @@ static void shader_arb_load_constants(
|
||||||
static void shader_arb_update_float_vertex_constants(IWineD3DDevice *iface, UINT start, UINT count)
|
static void shader_arb_update_float_vertex_constants(IWineD3DDevice *iface, UINT start, UINT count)
|
||||||
{
|
{
|
||||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||||
struct WineD3DContext *context = context_get_current();
|
struct wined3d_context *context = context_get_current();
|
||||||
|
|
||||||
/* We don't want shader constant dirtification to be an O(contexts), so just dirtify the active
|
/* We don't want shader constant dirtification to be an O(contexts), so just dirtify the active
|
||||||
* context. On a context switch the old context will be fully dirtified */
|
* context. On a context switch the old context will be fully dirtified */
|
||||||
|
@ -573,7 +573,7 @@ static void shader_arb_update_float_vertex_constants(IWineD3DDevice *iface, UINT
|
||||||
static void shader_arb_update_float_pixel_constants(IWineD3DDevice *iface, UINT start, UINT count)
|
static void shader_arb_update_float_pixel_constants(IWineD3DDevice *iface, UINT start, UINT count)
|
||||||
{
|
{
|
||||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||||
struct WineD3DContext *context = context_get_current();
|
struct wined3d_context *context = context_get_current();
|
||||||
|
|
||||||
/* We don't want shader constant dirtification to be an O(contexts), so just dirtify the active
|
/* We don't want shader constant dirtification to be an O(contexts), so just dirtify the active
|
||||||
* context. On a context switch the old context will be fully dirtified */
|
* context. On a context switch the old context will be fully dirtified */
|
||||||
|
@ -4215,7 +4215,7 @@ static inline void find_arb_vs_compile_args(IWineD3DVertexShaderImpl *shader, IW
|
||||||
static void shader_arb_select(IWineD3DDevice *iface, BOOL usePS, BOOL useVS) {
|
static void shader_arb_select(IWineD3DDevice *iface, BOOL usePS, BOOL useVS) {
|
||||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||||
struct shader_arb_priv *priv = This->shader_priv;
|
struct shader_arb_priv *priv = This->shader_priv;
|
||||||
struct WineD3DContext *context = context_get_current();
|
struct wined3d_context *context = context_get_current();
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -5161,7 +5161,8 @@ static void arbfp_get_caps(WINED3DDEVTYPE devtype, const struct wined3d_gl_info
|
||||||
#undef GLINFO_LOCATION
|
#undef GLINFO_LOCATION
|
||||||
|
|
||||||
#define GLINFO_LOCATION stateblock->wineD3DDevice->adapter->gl_info
|
#define GLINFO_LOCATION stateblock->wineD3DDevice->adapter->gl_info
|
||||||
static void state_texfactor_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_texfactor_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
float col[4];
|
float col[4];
|
||||||
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
|
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
|
||||||
|
|
||||||
|
@ -5182,7 +5183,8 @@ static void state_texfactor_arbfp(DWORD state, IWineD3DStateBlockImpl *statebloc
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_arb_specularenable(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_arb_specularenable(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
float col[4];
|
float col[4];
|
||||||
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
|
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
|
||||||
|
|
||||||
|
@ -5209,7 +5211,8 @@ static void state_arb_specularenable(DWORD state, IWineD3DStateBlockImpl *stateb
|
||||||
checkGLcall("glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_SPECULAR_ENABLE, col)");
|
checkGLcall("glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_SPECULAR_ENABLE, col)");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_bumpmat_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void set_bumpmat_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
||||||
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
|
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
|
||||||
float mat[2][2];
|
float mat[2][2];
|
||||||
|
@ -5244,7 +5247,8 @@ static void set_bumpmat_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, W
|
||||||
checkGLcall("glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_BUMPMAT(stage), &mat[0][0])");
|
checkGLcall("glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_BUMPMAT(stage), &mat[0][0])");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tex_bumpenvlum_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void tex_bumpenvlum_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
||||||
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
|
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
|
||||||
float param[4];
|
float param[4];
|
||||||
|
@ -5751,7 +5755,8 @@ static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, IWi
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fragment_prog_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void fragment_prog_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
|
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
|
||||||
struct shader_arb_priv *priv = device->fragment_priv;
|
struct shader_arb_priv *priv = device->fragment_priv;
|
||||||
BOOL use_pshader = use_ps(stateblock);
|
BOOL use_pshader = use_ps(stateblock);
|
||||||
|
@ -5848,7 +5853,8 @@ static void fragment_prog_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock,
|
||||||
* is that changing the fog start and fog end(which links to FOGENABLE in vertex) results in the
|
* is that changing the fog start and fog end(which links to FOGENABLE in vertex) results in the
|
||||||
* fragment_prog_arbfp function being called because FOGENABLE is dirty, which calls this function here
|
* fragment_prog_arbfp function being called because FOGENABLE is dirty, which calls this function here
|
||||||
*/
|
*/
|
||||||
static void state_arbfp_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_arbfp_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
enum fogsource new_source;
|
enum fogsource new_source;
|
||||||
|
|
||||||
TRACE("state %#x, stateblock %p, context %p\n", state, stateblock, context);
|
TRACE("state %#x, stateblock %p, context %p\n", state, stateblock, context);
|
||||||
|
@ -5878,7 +5884,8 @@ static void state_arbfp_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, Win
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void textransform(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void textransform(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(!isStateDirty(context, STATE_PIXELSHADER)) {
|
if(!isStateDirty(context, STATE_PIXELSHADER)) {
|
||||||
fragment_prog_arbfp(state, stateblock, context);
|
fragment_prog_arbfp(state, stateblock, context);
|
||||||
}
|
}
|
||||||
|
|
|
@ -796,7 +796,8 @@ static GLuint gen_ati_shader(const struct texture_stage_op op[MAX_TEXTURES], con
|
||||||
#undef GLINFO_LOCATION
|
#undef GLINFO_LOCATION
|
||||||
|
|
||||||
#define GLINFO_LOCATION stateblock->wineD3DDevice->adapter->gl_info
|
#define GLINFO_LOCATION stateblock->wineD3DDevice->adapter->gl_info
|
||||||
static void set_tex_op_atifs(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void set_tex_op_atifs(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
IWineD3DDeviceImpl *This = stateblock->wineD3DDevice;
|
IWineD3DDeviceImpl *This = stateblock->wineD3DDevice;
|
||||||
const struct atifs_ffp_desc *desc;
|
const struct atifs_ffp_desc *desc;
|
||||||
struct ffp_frag_settings settings;
|
struct ffp_frag_settings settings;
|
||||||
|
@ -842,7 +843,8 @@ static void set_tex_op_atifs(DWORD state, IWineD3DStateBlockImpl *stateblock, Wi
|
||||||
GL_EXTCALL(glBindFragmentShaderATI(desc->shader));
|
GL_EXTCALL(glBindFragmentShaderATI(desc->shader));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_texfactor_atifs(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_texfactor_atifs(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
float col[4];
|
float col[4];
|
||||||
D3DCOLORTOGLFLOAT4(stateblock->renderState[WINED3DRS_TEXTUREFACTOR], col);
|
D3DCOLORTOGLFLOAT4(stateblock->renderState[WINED3DRS_TEXTUREFACTOR], col);
|
||||||
|
|
||||||
|
@ -850,7 +852,8 @@ static void state_texfactor_atifs(DWORD state, IWineD3DStateBlockImpl *statebloc
|
||||||
checkGLcall("glSetFragmentShaderConstantATI(ATI_FFP_CONST_TFACTOR, col)");
|
checkGLcall("glSetFragmentShaderConstantATI(ATI_FFP_CONST_TFACTOR, col)");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_bumpmat(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void set_bumpmat(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
||||||
float mat[2][2];
|
float mat[2][2];
|
||||||
|
|
||||||
|
@ -873,13 +876,15 @@ static void set_bumpmat(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
|
||||||
checkGLcall("glSetFragmentShaderConstantATI(ATI_FFP_CONST_BUMPMAT(stage), mat)");
|
checkGLcall("glSetFragmentShaderConstantATI(ATI_FFP_CONST_BUMPMAT(stage), mat)");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void textransform(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void textransform(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(!isStateDirty(context, STATE_PIXELSHADER)) {
|
if(!isStateDirty(context, STATE_PIXELSHADER)) {
|
||||||
set_tex_op_atifs(state, stateblock, context);
|
set_tex_op_atifs(state, stateblock, context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void atifs_apply_pixelshader(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void atifs_apply_pixelshader(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
|
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
|
||||||
BOOL use_vshader = use_vs(stateblock);
|
BOOL use_vshader = use_vs(stateblock);
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ static DWORD wined3d_context_tls_idx;
|
||||||
/* FBO helper functions */
|
/* FBO helper functions */
|
||||||
|
|
||||||
/* GL locking is done by the caller */
|
/* GL locking is done by the caller */
|
||||||
void context_bind_fbo(struct WineD3DContext *context, GLenum target, GLuint *fbo)
|
void context_bind_fbo(struct wined3d_context *context, GLenum target, GLuint *fbo)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||||
GLuint f;
|
GLuint f;
|
||||||
|
@ -101,7 +101,7 @@ static void context_clean_fbo_attachments(const struct wined3d_gl_info *gl_info)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GL locking is done by the caller */
|
/* GL locking is done by the caller */
|
||||||
static void context_destroy_fbo(struct WineD3DContext *context, GLuint *fbo)
|
static void context_destroy_fbo(struct wined3d_context *context, GLuint *fbo)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ static void context_apply_attachment_filter_states(IWineD3DSurface *surface, BOO
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GL locking is done by the caller */
|
/* GL locking is done by the caller */
|
||||||
void context_attach_depth_stencil_fbo(struct WineD3DContext *context,
|
void context_attach_depth_stencil_fbo(struct wined3d_context *context,
|
||||||
GLenum fbo_target, IWineD3DSurface *depth_stencil, BOOL use_render_buffer)
|
GLenum fbo_target, IWineD3DSurface *depth_stencil, BOOL use_render_buffer)
|
||||||
{
|
{
|
||||||
IWineD3DSurfaceImpl *depth_stencil_impl = (IWineD3DSurfaceImpl *)depth_stencil;
|
IWineD3DSurfaceImpl *depth_stencil_impl = (IWineD3DSurfaceImpl *)depth_stencil;
|
||||||
|
@ -250,7 +250,7 @@ void context_attach_depth_stencil_fbo(struct WineD3DContext *context,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GL locking is done by the caller */
|
/* GL locking is done by the caller */
|
||||||
void context_attach_surface_fbo(const struct WineD3DContext *context,
|
void context_attach_surface_fbo(const struct wined3d_context *context,
|
||||||
GLenum fbo_target, DWORD idx, IWineD3DSurface *surface)
|
GLenum fbo_target, DWORD idx, IWineD3DSurface *surface)
|
||||||
{
|
{
|
||||||
const IWineD3DSurfaceImpl *surface_impl = (IWineD3DSurfaceImpl *)surface;
|
const IWineD3DSurfaceImpl *surface_impl = (IWineD3DSurfaceImpl *)surface;
|
||||||
|
@ -272,7 +272,7 @@ void context_attach_surface_fbo(const struct WineD3DContext *context,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GL locking is done by the caller */
|
/* GL locking is done by the caller */
|
||||||
static void context_check_fbo_status(struct WineD3DContext *context)
|
static void context_check_fbo_status(struct wined3d_context *context)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||||
GLenum status;
|
GLenum status;
|
||||||
|
@ -307,7 +307,7 @@ static void context_check_fbo_status(struct WineD3DContext *context)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct fbo_entry *context_create_fbo_entry(struct WineD3DContext *context)
|
static struct fbo_entry *context_create_fbo_entry(struct wined3d_context *context)
|
||||||
{
|
{
|
||||||
IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice;
|
IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice;
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||||
|
@ -324,7 +324,7 @@ static struct fbo_entry *context_create_fbo_entry(struct WineD3DContext *context
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GL locking is done by the caller */
|
/* GL locking is done by the caller */
|
||||||
static void context_reuse_fbo_entry(struct WineD3DContext *context, struct fbo_entry *entry)
|
static void context_reuse_fbo_entry(struct wined3d_context *context, struct fbo_entry *entry)
|
||||||
{
|
{
|
||||||
IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice;
|
IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice;
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||||
|
@ -338,7 +338,7 @@ static void context_reuse_fbo_entry(struct WineD3DContext *context, struct fbo_e
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GL locking is done by the caller */
|
/* GL locking is done by the caller */
|
||||||
static void context_destroy_fbo_entry(struct WineD3DContext *context, struct fbo_entry *entry)
|
static void context_destroy_fbo_entry(struct wined3d_context *context, struct fbo_entry *entry)
|
||||||
{
|
{
|
||||||
if (entry->id)
|
if (entry->id)
|
||||||
{
|
{
|
||||||
|
@ -353,7 +353,7 @@ static void context_destroy_fbo_entry(struct WineD3DContext *context, struct fbo
|
||||||
|
|
||||||
|
|
||||||
/* GL locking is done by the caller */
|
/* GL locking is done by the caller */
|
||||||
static struct fbo_entry *context_find_fbo_entry(struct WineD3DContext *context)
|
static struct fbo_entry *context_find_fbo_entry(struct wined3d_context *context)
|
||||||
{
|
{
|
||||||
IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice;
|
IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice;
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||||
|
@ -388,7 +388,7 @@ static struct fbo_entry *context_find_fbo_entry(struct WineD3DContext *context)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GL locking is done by the caller */
|
/* GL locking is done by the caller */
|
||||||
static void context_apply_fbo_entry(struct WineD3DContext *context, struct fbo_entry *entry)
|
static void context_apply_fbo_entry(struct wined3d_context *context, struct fbo_entry *entry)
|
||||||
{
|
{
|
||||||
IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice;
|
IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice;
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||||
|
@ -436,7 +436,7 @@ static void context_apply_fbo_entry(struct WineD3DContext *context, struct fbo_e
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GL locking is done by the caller */
|
/* GL locking is done by the caller */
|
||||||
static void context_apply_fbo_state(struct WineD3DContext *context)
|
static void context_apply_fbo_state(struct wined3d_context *context)
|
||||||
{
|
{
|
||||||
IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice;
|
IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->surface)->resource.wineD3DDevice;
|
||||||
|
|
||||||
|
@ -453,7 +453,7 @@ static void context_apply_fbo_state(struct WineD3DContext *context)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Context activation is done by the caller. */
|
/* Context activation is done by the caller. */
|
||||||
void context_alloc_occlusion_query(struct WineD3DContext *context, struct wined3d_occlusion_query *query)
|
void context_alloc_occlusion_query(struct wined3d_context *context, struct wined3d_occlusion_query *query)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||||
|
|
||||||
|
@ -485,7 +485,7 @@ void context_alloc_occlusion_query(struct WineD3DContext *context, struct wined3
|
||||||
|
|
||||||
void context_free_occlusion_query(struct wined3d_occlusion_query *query)
|
void context_free_occlusion_query(struct wined3d_occlusion_query *query)
|
||||||
{
|
{
|
||||||
struct WineD3DContext *context = query->context;
|
struct wined3d_context *context = query->context;
|
||||||
|
|
||||||
list_remove(&query->entry);
|
list_remove(&query->entry);
|
||||||
query->context = NULL;
|
query->context = NULL;
|
||||||
|
@ -510,7 +510,7 @@ void context_free_occlusion_query(struct wined3d_occlusion_query *query)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Context activation is done by the caller. */
|
/* Context activation is done by the caller. */
|
||||||
void context_alloc_event_query(struct WineD3DContext *context, struct wined3d_event_query *query)
|
void context_alloc_event_query(struct wined3d_context *context, struct wined3d_event_query *query)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||||
|
|
||||||
|
@ -551,7 +551,7 @@ void context_alloc_event_query(struct WineD3DContext *context, struct wined3d_ev
|
||||||
|
|
||||||
void context_free_event_query(struct wined3d_event_query *query)
|
void context_free_event_query(struct wined3d_event_query *query)
|
||||||
{
|
{
|
||||||
struct WineD3DContext *context = query->context;
|
struct wined3d_context *context = query->context;
|
||||||
|
|
||||||
list_remove(&query->entry);
|
list_remove(&query->entry);
|
||||||
query->context = NULL;
|
query->context = NULL;
|
||||||
|
@ -590,7 +590,7 @@ void context_resource_released(IWineD3DDevice *iface, IWineD3DResource *resource
|
||||||
|
|
||||||
for (i = 0; i < This->numContexts; ++i)
|
for (i = 0; i < This->numContexts; ++i)
|
||||||
{
|
{
|
||||||
WineD3DContext *context = This->contexts[i];
|
struct wined3d_context *context = This->contexts[i];
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||||
struct fbo_entry *entry, *entry2;
|
struct fbo_entry *entry, *entry2;
|
||||||
|
|
||||||
|
@ -627,7 +627,7 @@ void context_resource_released(IWineD3DDevice *iface, IWineD3DResource *resource
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void context_destroy_gl_resources(struct WineD3DContext *context)
|
static void context_destroy_gl_resources(struct wined3d_context *context)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||||
struct wined3d_occlusion_query *occlusion_query;
|
struct wined3d_occlusion_query *occlusion_query;
|
||||||
|
@ -720,14 +720,14 @@ void context_set_tls_idx(DWORD idx)
|
||||||
wined3d_context_tls_idx = idx;
|
wined3d_context_tls_idx = idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct WineD3DContext *context_get_current(void)
|
struct wined3d_context *context_get_current(void)
|
||||||
{
|
{
|
||||||
return TlsGetValue(wined3d_context_tls_idx);
|
return TlsGetValue(wined3d_context_tls_idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL context_set_current(struct WineD3DContext *ctx)
|
BOOL context_set_current(struct wined3d_context *ctx)
|
||||||
{
|
{
|
||||||
struct WineD3DContext *old = context_get_current();
|
struct wined3d_context *old = context_get_current();
|
||||||
|
|
||||||
if (old == ctx)
|
if (old == ctx)
|
||||||
{
|
{
|
||||||
|
@ -785,7 +785,8 @@ BOOL context_set_current(struct WineD3DContext *ctx)
|
||||||
* StateTable: Pointer to the state table in use(for state grouping)
|
* StateTable: Pointer to the state table in use(for state grouping)
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
static void Context_MarkStateDirty(WineD3DContext *context, DWORD state, const struct StateEntry *StateTable) {
|
static void Context_MarkStateDirty(struct wined3d_context *context, DWORD state, const struct StateEntry *StateTable)
|
||||||
|
{
|
||||||
DWORD rep = StateTable[state].representative;
|
DWORD rep = StateTable[state].representative;
|
||||||
DWORD idx;
|
DWORD idx;
|
||||||
BYTE shift;
|
BYTE shift;
|
||||||
|
@ -814,8 +815,10 @@ static void Context_MarkStateDirty(WineD3DContext *context, DWORD state, const s
|
||||||
* pbuffer: optional pbuffer used with this context
|
* pbuffer: optional pbuffer used with this context
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
static WineD3DContext *AddContextToArray(IWineD3DDeviceImpl *This, HWND win_handle, HDC hdc, HGLRC glCtx, HPBUFFERARB pbuffer) {
|
static struct wined3d_context *AddContextToArray(IWineD3DDeviceImpl *This,
|
||||||
WineD3DContext **oldArray = This->contexts;
|
HWND win_handle, HDC hdc, HGLRC glCtx, HPBUFFERARB pbuffer)
|
||||||
|
{
|
||||||
|
struct wined3d_context **oldArray = This->contexts;
|
||||||
DWORD state;
|
DWORD state;
|
||||||
|
|
||||||
This->contexts = HeapAlloc(GetProcessHeap(), 0, sizeof(*This->contexts) * (This->numContexts + 1));
|
This->contexts = HeapAlloc(GetProcessHeap(), 0, sizeof(*This->contexts) * (This->numContexts + 1));
|
||||||
|
@ -828,7 +831,7 @@ static WineD3DContext *AddContextToArray(IWineD3DDeviceImpl *This, HWND win_hand
|
||||||
memcpy(This->contexts, oldArray, sizeof(*This->contexts) * This->numContexts);
|
memcpy(This->contexts, oldArray, sizeof(*This->contexts) * This->numContexts);
|
||||||
}
|
}
|
||||||
|
|
||||||
This->contexts[This->numContexts] = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WineD3DContext));
|
This->contexts[This->numContexts] = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(**This->contexts));
|
||||||
if(This->contexts[This->numContexts] == NULL) {
|
if(This->contexts[This->numContexts] == NULL) {
|
||||||
ERR("Unable to allocate a new context\n");
|
ERR("Unable to allocate a new context\n");
|
||||||
HeapFree(GetProcessHeap(), 0, This->contexts);
|
HeapFree(GetProcessHeap(), 0, This->contexts);
|
||||||
|
@ -1044,10 +1047,12 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc,
|
||||||
* pPresentParameters: contains the pixelformats to use for onscreen rendering
|
* pPresentParameters: contains the pixelformats to use for onscreen rendering
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *target, HWND win_handle, BOOL create_pbuffer, const WINED3DPRESENT_PARAMETERS *pPresentParms) {
|
struct wined3d_context *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *target,
|
||||||
|
HWND win_handle, BOOL create_pbuffer, const WINED3DPRESENT_PARAMETERS *pPresentParms)
|
||||||
|
{
|
||||||
const struct wined3d_gl_info *gl_info = &This->adapter->gl_info;
|
const struct wined3d_gl_info *gl_info = &This->adapter->gl_info;
|
||||||
|
struct wined3d_context *ret = NULL;
|
||||||
HPBUFFERARB pbuffer = NULL;
|
HPBUFFERARB pbuffer = NULL;
|
||||||
WineD3DContext *ret = NULL;
|
|
||||||
unsigned int s;
|
unsigned int s;
|
||||||
HGLRC ctx;
|
HGLRC ctx;
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
|
@ -1382,8 +1387,9 @@ out:
|
||||||
* context: Context to remove
|
* context: Context to remove
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
static void RemoveContextFromArray(IWineD3DDeviceImpl *This, WineD3DContext *context) {
|
static void RemoveContextFromArray(IWineD3DDeviceImpl *This, struct wined3d_context *context)
|
||||||
WineD3DContext **new_array;
|
{
|
||||||
|
struct wined3d_context **new_array;
|
||||||
BOOL found = FALSE;
|
BOOL found = FALSE;
|
||||||
UINT i;
|
UINT i;
|
||||||
|
|
||||||
|
@ -1438,7 +1444,7 @@ static void RemoveContextFromArray(IWineD3DDeviceImpl *This, WineD3DContext *con
|
||||||
* context: Context to destroy
|
* context: Context to destroy
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
void DestroyContext(IWineD3DDeviceImpl *This, WineD3DContext *context)
|
void DestroyContext(IWineD3DDeviceImpl *This, struct wined3d_context *context)
|
||||||
{
|
{
|
||||||
BOOL destroy;
|
BOOL destroy;
|
||||||
|
|
||||||
|
@ -1497,7 +1503,8 @@ static inline void set_blit_dimension(UINT width, UINT height) {
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
/* Context activation is done by the caller. */
|
/* Context activation is done by the caller. */
|
||||||
static inline void SetupForBlit(IWineD3DDeviceImpl *This, WineD3DContext *context, UINT width, UINT height) {
|
static inline void SetupForBlit(IWineD3DDeviceImpl *This, struct wined3d_context *context, UINT width, UINT height)
|
||||||
|
{
|
||||||
int i, sampler;
|
int i, sampler;
|
||||||
const struct StateEntry *StateTable = This->StateTable;
|
const struct StateEntry *StateTable = This->StateTable;
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||||
|
@ -1686,7 +1693,8 @@ static inline void SetupForBlit(IWineD3DDeviceImpl *This, WineD3DContext *contex
|
||||||
* If none can be found the swapchain is requested to create a new context
|
* If none can be found the swapchain is requested to create a new context
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
static WineD3DContext *findThreadContextForSwapChain(IWineD3DSwapChain *swapchain, DWORD tid) {
|
static struct wined3d_context *findThreadContextForSwapChain(IWineD3DSwapChain *swapchain, DWORD tid)
|
||||||
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
for(i = 0; i < ((IWineD3DSwapChainImpl *) swapchain)->num_contexts; i++) {
|
for(i = 0; i < ((IWineD3DSwapChainImpl *) swapchain)->num_contexts; i++) {
|
||||||
|
@ -1712,13 +1720,14 @@ static WineD3DContext *findThreadContextForSwapChain(IWineD3DSwapChain *swapchai
|
||||||
* Returns: The needed context
|
* Returns: The needed context
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
static inline WineD3DContext *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, DWORD tid) {
|
static inline struct wined3d_context *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, DWORD tid)
|
||||||
|
{
|
||||||
IWineD3DSwapChain *swapchain = NULL;
|
IWineD3DSwapChain *swapchain = NULL;
|
||||||
BOOL readTexture = wined3d_settings.offscreen_rendering_mode != ORM_FBO && This->render_offscreen;
|
BOOL readTexture = wined3d_settings.offscreen_rendering_mode != ORM_FBO && This->render_offscreen;
|
||||||
struct WineD3DContext *current_context = context_get_current();
|
struct wined3d_context *current_context = context_get_current();
|
||||||
BOOL oldRenderOffscreen = This->render_offscreen;
|
BOOL oldRenderOffscreen = This->render_offscreen;
|
||||||
const struct StateEntry *StateTable = This->StateTable;
|
const struct StateEntry *StateTable = This->StateTable;
|
||||||
struct WineD3DContext *context;
|
struct wined3d_context *context;
|
||||||
|
|
||||||
if (current_context && current_context->destroyed) current_context = NULL;
|
if (current_context && current_context->destroyed) current_context = NULL;
|
||||||
|
|
||||||
|
@ -1914,7 +1923,7 @@ retry:
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Context activation is done by the caller. */
|
/* Context activation is done by the caller. */
|
||||||
static void context_apply_draw_buffer(struct WineD3DContext *context, BOOL blit)
|
static void context_apply_draw_buffer(struct wined3d_context *context, BOOL blit)
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info = context->gl_info;
|
const struct wined3d_gl_info *gl_info = context->gl_info;
|
||||||
IWineD3DSurface *rt = context->current_rt;
|
IWineD3DSurface *rt = context->current_rt;
|
||||||
|
@ -1974,15 +1983,15 @@ static void context_apply_draw_buffer(struct WineD3DContext *context, BOOL blit)
|
||||||
* usage: Prepares the context for blitting, drawing or other actions
|
* usage: Prepares the context for blitting, drawing or other actions
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
struct WineD3DContext *ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, enum ContextUsage usage)
|
struct wined3d_context *ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, enum ContextUsage usage)
|
||||||
{
|
{
|
||||||
struct WineD3DContext *current_context = context_get_current();
|
struct wined3d_context *current_context = context_get_current();
|
||||||
DWORD tid = GetCurrentThreadId();
|
DWORD tid = GetCurrentThreadId();
|
||||||
DWORD i, dirtyState, idx;
|
DWORD i, dirtyState, idx;
|
||||||
BYTE shift;
|
BYTE shift;
|
||||||
WineD3DContext *context;
|
|
||||||
const struct StateEntry *StateTable = This->StateTable;
|
const struct StateEntry *StateTable = This->StateTable;
|
||||||
const struct wined3d_gl_info *gl_info;
|
const struct wined3d_gl_info *gl_info;
|
||||||
|
struct wined3d_context *context;
|
||||||
|
|
||||||
TRACE("(%p): Selecting context for render target %p, thread %d\n", This, target, tid);
|
TRACE("(%p): Selecting context for render target %p, thread %d\n", This, target, tid);
|
||||||
|
|
||||||
|
|
|
@ -4888,7 +4888,7 @@ HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This, IWineD3DSurfa
|
||||||
UINT drawable_width, drawable_height;
|
UINT drawable_width, drawable_height;
|
||||||
IWineD3DSurfaceImpl *depth_stencil = (IWineD3DSurfaceImpl *) This->stencilBufferTarget;
|
IWineD3DSurfaceImpl *depth_stencil = (IWineD3DSurfaceImpl *) This->stencilBufferTarget;
|
||||||
IWineD3DSwapChainImpl *swapchain = NULL;
|
IWineD3DSwapChainImpl *swapchain = NULL;
|
||||||
struct WineD3DContext *context;
|
struct wined3d_context *context;
|
||||||
|
|
||||||
/* When we're clearing parts of the drawable, make sure that the target surface is well up to date in the
|
/* When we're clearing parts of the drawable, make sure that the target surface is well up to date in the
|
||||||
* drawable. After the clear we'll mark the drawable up to date, so we have to make sure that this is true
|
* drawable. After the clear we'll mark the drawable up to date, so we have to make sure that this is true
|
||||||
|
@ -6011,7 +6011,7 @@ static void color_fill_fbo(IWineD3DDevice *iface, IWineD3DSurface *surface,
|
||||||
const WINED3DRECT *rect, const float color[4])
|
const WINED3DRECT *rect, const float color[4])
|
||||||
{
|
{
|
||||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface;
|
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface;
|
||||||
struct WineD3DContext *context;
|
struct wined3d_context *context;
|
||||||
IWineD3DSwapChain *swapchain;
|
IWineD3DSwapChain *swapchain;
|
||||||
|
|
||||||
swapchain = get_swapchain(surface);
|
swapchain = get_swapchain(surface);
|
||||||
|
@ -6390,7 +6390,7 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED
|
||||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||||
GLbitfield mask = GL_COLOR_BUFFER_BIT; /* TODO: Support blitting depth/stencil surfaces */
|
GLbitfield mask = GL_COLOR_BUFFER_BIT; /* TODO: Support blitting depth/stencil surfaces */
|
||||||
IWineD3DSwapChain *src_swapchain, *dst_swapchain;
|
IWineD3DSwapChain *src_swapchain, *dst_swapchain;
|
||||||
struct WineD3DContext *context;
|
struct wined3d_context *context;
|
||||||
GLenum gl_filter;
|
GLenum gl_filter;
|
||||||
POINT offset = {0, 0};
|
POINT offset = {0, 0};
|
||||||
|
|
||||||
|
@ -6593,7 +6593,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetDepthStencilSurface(IWineD3DDevice *
|
||||||
|| ((IWineD3DSurfaceImpl *)This->stencilBufferTarget)->Flags & SFLAG_DISCARD) {
|
|| ((IWineD3DSurfaceImpl *)This->stencilBufferTarget)->Flags & SFLAG_DISCARD) {
|
||||||
surface_modify_ds_location(This->stencilBufferTarget, SFLAG_DS_DISCARDED);
|
surface_modify_ds_location(This->stencilBufferTarget, SFLAG_DS_DISCARDED);
|
||||||
} else {
|
} else {
|
||||||
struct WineD3DContext *context = ActivateContext(This, This->render_targets[0], CTXUSAGE_RESOURCELOAD);
|
struct wined3d_context *context = ActivateContext(This, This->render_targets[0], CTXUSAGE_RESOURCELOAD);
|
||||||
surface_load_ds_location(This->stencilBufferTarget, context, SFLAG_DS_OFFSCREEN);
|
surface_load_ds_location(This->stencilBufferTarget, context, SFLAG_DS_OFFSCREEN);
|
||||||
surface_modify_ds_location(This->stencilBufferTarget, SFLAG_DS_OFFSCREEN);
|
surface_modify_ds_location(This->stencilBufferTarget, SFLAG_DS_OFFSCREEN);
|
||||||
}
|
}
|
||||||
|
@ -7679,10 +7679,10 @@ const DWORD SavedVertexStates_S[NUM_SAVEDVERTEXSTATES_S] = {
|
||||||
|
|
||||||
void IWineD3DDeviceImpl_MarkStateDirty(IWineD3DDeviceImpl *This, DWORD state) {
|
void IWineD3DDeviceImpl_MarkStateDirty(IWineD3DDeviceImpl *This, DWORD state) {
|
||||||
DWORD rep = This->StateTable[state].representative;
|
DWORD rep = This->StateTable[state].representative;
|
||||||
|
struct wined3d_context *context;
|
||||||
DWORD idx;
|
DWORD idx;
|
||||||
BYTE shift;
|
BYTE shift;
|
||||||
UINT i;
|
UINT i;
|
||||||
WineD3DContext *context;
|
|
||||||
|
|
||||||
if(!rep) return;
|
if(!rep) return;
|
||||||
for(i = 0; i < This->numContexts; i++) {
|
for(i = 0; i < This->numContexts; i++) {
|
||||||
|
@ -7696,7 +7696,7 @@ void IWineD3DDeviceImpl_MarkStateDirty(IWineD3DDeviceImpl *This, DWORD state) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void get_drawable_size_pbuffer(struct WineD3DContext *context, UINT *width, UINT *height)
|
void get_drawable_size_pbuffer(struct wined3d_context *context, UINT *width, UINT *height)
|
||||||
{
|
{
|
||||||
IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->current_rt)->resource.wineD3DDevice;
|
IWineD3DDeviceImpl *device = ((IWineD3DSurfaceImpl *)context->current_rt)->resource.wineD3DDevice;
|
||||||
/* The drawable size of a pbuffer render target is the current pbuffer size. */
|
/* The drawable size of a pbuffer render target is the current pbuffer size. */
|
||||||
|
@ -7704,7 +7704,7 @@ void get_drawable_size_pbuffer(struct WineD3DContext *context, UINT *width, UINT
|
||||||
*height = device->pbufferHeight;
|
*height = device->pbufferHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
void get_drawable_size_fbo(struct WineD3DContext *context, UINT *width, UINT *height)
|
void get_drawable_size_fbo(struct wined3d_context *context, UINT *width, UINT *height)
|
||||||
{
|
{
|
||||||
IWineD3DSurfaceImpl *surface = (IWineD3DSurfaceImpl *)context->current_rt;
|
IWineD3DSurfaceImpl *surface = (IWineD3DSurfaceImpl *)context->current_rt;
|
||||||
/* The drawable size of a fbo target is the opengl texture size, which is the power of two size. */
|
/* The drawable size of a fbo target is the opengl texture size, which is the power of two size. */
|
||||||
|
@ -7712,7 +7712,7 @@ void get_drawable_size_fbo(struct WineD3DContext *context, UINT *width, UINT *he
|
||||||
*height = surface->pow2Height;
|
*height = surface->pow2Height;
|
||||||
}
|
}
|
||||||
|
|
||||||
void get_drawable_size_backbuffer(struct WineD3DContext *context, UINT *width, UINT *height)
|
void get_drawable_size_backbuffer(struct wined3d_context *context, UINT *width, UINT *height)
|
||||||
{
|
{
|
||||||
IWineD3DSurfaceImpl *surface = (IWineD3DSurfaceImpl *)context->surface;
|
IWineD3DSurfaceImpl *surface = (IWineD3DSurfaceImpl *)context->surface;
|
||||||
/* The drawable size of a backbuffer / aux buffer offscreen target is the size of the
|
/* The drawable size of a backbuffer / aux buffer offscreen target is the size of the
|
||||||
|
|
|
@ -73,7 +73,7 @@ static void drawStridedFast(IWineD3DDevice *iface, GLenum primitive_type,
|
||||||
static void drawStridedSlow(IWineD3DDevice *iface, const struct wined3d_stream_info *si, UINT NumVertexes,
|
static void drawStridedSlow(IWineD3DDevice *iface, const struct wined3d_stream_info *si, UINT NumVertexes,
|
||||||
GLenum glPrimType, const void *idxData, UINT idxSize, UINT minIndex, UINT startIdx)
|
GLenum glPrimType, const void *idxData, UINT idxSize, UINT minIndex, UINT startIdx)
|
||||||
{
|
{
|
||||||
struct WineD3DContext *context = context_get_current();
|
struct wined3d_context *context = context_get_current();
|
||||||
unsigned int textureNo = 0;
|
unsigned int textureNo = 0;
|
||||||
const WORD *pIdxBufS = NULL;
|
const WORD *pIdxBufS = NULL;
|
||||||
const DWORD *pIdxBufL = NULL;
|
const DWORD *pIdxBufL = NULL;
|
||||||
|
@ -559,7 +559,7 @@ void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT numberOfVertice
|
||||||
|
|
||||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||||
IWineD3DSurfaceImpl *target;
|
IWineD3DSurfaceImpl *target;
|
||||||
struct WineD3DContext *context;
|
struct wined3d_context *context;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
if (!index_count) return;
|
if (!index_count) return;
|
||||||
|
|
|
@ -147,7 +147,7 @@ static void WINE_GLAPI wine_glGetDoublev(GLenum pname, GLdouble* params) {
|
||||||
static void (WINE_GLAPI *old_fogcoord_glEnable) (GLenum cap) = NULL;
|
static void (WINE_GLAPI *old_fogcoord_glEnable) (GLenum cap) = NULL;
|
||||||
static void WINE_GLAPI wine_glEnable(GLenum cap) {
|
static void WINE_GLAPI wine_glEnable(GLenum cap) {
|
||||||
if(cap == GL_FOG) {
|
if(cap == GL_FOG) {
|
||||||
struct WineD3DContext *ctx = context_get_current();
|
struct wined3d_context *ctx = context_get_current();
|
||||||
ctx->fog_enabled = 1;
|
ctx->fog_enabled = 1;
|
||||||
if(ctx->gl_fog_source != GL_FRAGMENT_DEPTH_EXT) return;
|
if(ctx->gl_fog_source != GL_FRAGMENT_DEPTH_EXT) return;
|
||||||
}
|
}
|
||||||
|
@ -157,7 +157,7 @@ static void WINE_GLAPI wine_glEnable(GLenum cap) {
|
||||||
static void (WINE_GLAPI *old_fogcoord_glDisable) (GLenum cap) = NULL;
|
static void (WINE_GLAPI *old_fogcoord_glDisable) (GLenum cap) = NULL;
|
||||||
static void WINE_GLAPI wine_glDisable(GLenum cap) {
|
static void WINE_GLAPI wine_glDisable(GLenum cap) {
|
||||||
if(cap == GL_FOG) {
|
if(cap == GL_FOG) {
|
||||||
struct WineD3DContext *ctx = context_get_current();
|
struct wined3d_context *ctx = context_get_current();
|
||||||
ctx->fog_enabled = 0;
|
ctx->fog_enabled = 0;
|
||||||
if(ctx->gl_fog_source != GL_FRAGMENT_DEPTH_EXT) return;
|
if(ctx->gl_fog_source != GL_FRAGMENT_DEPTH_EXT) return;
|
||||||
}
|
}
|
||||||
|
@ -166,7 +166,7 @@ static void WINE_GLAPI wine_glDisable(GLenum cap) {
|
||||||
|
|
||||||
static void (WINE_GLAPI *old_fogcoord_glFogi) (GLenum pname, GLint param) = NULL;
|
static void (WINE_GLAPI *old_fogcoord_glFogi) (GLenum pname, GLint param) = NULL;
|
||||||
static void WINE_GLAPI wine_glFogi(GLenum pname, GLint param) {
|
static void WINE_GLAPI wine_glFogi(GLenum pname, GLint param) {
|
||||||
struct WineD3DContext *ctx = context_get_current();
|
struct wined3d_context *ctx = context_get_current();
|
||||||
|
|
||||||
if(pname == GL_FOG_COORDINATE_SOURCE_EXT) {
|
if(pname == GL_FOG_COORDINATE_SOURCE_EXT) {
|
||||||
ctx->gl_fog_source = param;
|
ctx->gl_fog_source = param;
|
||||||
|
@ -188,7 +188,7 @@ static void WINE_GLAPI wine_glFogi(GLenum pname, GLint param) {
|
||||||
|
|
||||||
static void (WINE_GLAPI *old_fogcoord_glFogiv) (GLenum pname, const GLint *param) = NULL;
|
static void (WINE_GLAPI *old_fogcoord_glFogiv) (GLenum pname, const GLint *param) = NULL;
|
||||||
static void WINE_GLAPI wine_glFogiv(GLenum pname, const GLint *param) {
|
static void WINE_GLAPI wine_glFogiv(GLenum pname, const GLint *param) {
|
||||||
struct WineD3DContext *ctx = context_get_current();
|
struct wined3d_context *ctx = context_get_current();
|
||||||
if(pname == GL_FOG_COORDINATE_SOURCE_EXT) {
|
if(pname == GL_FOG_COORDINATE_SOURCE_EXT) {
|
||||||
ctx->gl_fog_source = *param;
|
ctx->gl_fog_source = *param;
|
||||||
if(*param == GL_FRAGMENT_DEPTH_EXT) {
|
if(*param == GL_FRAGMENT_DEPTH_EXT) {
|
||||||
|
@ -209,7 +209,7 @@ static void WINE_GLAPI wine_glFogiv(GLenum pname, const GLint *param) {
|
||||||
|
|
||||||
static void (WINE_GLAPI *old_fogcoord_glFogf) (GLenum pname, GLfloat param) = NULL;
|
static void (WINE_GLAPI *old_fogcoord_glFogf) (GLenum pname, GLfloat param) = NULL;
|
||||||
static void WINE_GLAPI wine_glFogf(GLenum pname, GLfloat param) {
|
static void WINE_GLAPI wine_glFogf(GLenum pname, GLfloat param) {
|
||||||
struct WineD3DContext *ctx = context_get_current();
|
struct wined3d_context *ctx = context_get_current();
|
||||||
if(pname == GL_FOG_COORDINATE_SOURCE_EXT) {
|
if(pname == GL_FOG_COORDINATE_SOURCE_EXT) {
|
||||||
ctx->gl_fog_source = (GLint) param;
|
ctx->gl_fog_source = (GLint) param;
|
||||||
if(param == GL_FRAGMENT_DEPTH_EXT) {
|
if(param == GL_FRAGMENT_DEPTH_EXT) {
|
||||||
|
@ -230,7 +230,7 @@ static void WINE_GLAPI wine_glFogf(GLenum pname, GLfloat param) {
|
||||||
|
|
||||||
static void (WINE_GLAPI *old_fogcoord_glFogfv) (GLenum pname, const GLfloat *param) = NULL;
|
static void (WINE_GLAPI *old_fogcoord_glFogfv) (GLenum pname, const GLfloat *param) = NULL;
|
||||||
static void WINE_GLAPI wine_glFogfv(GLenum pname, const GLfloat *param) {
|
static void WINE_GLAPI wine_glFogfv(GLenum pname, const GLfloat *param) {
|
||||||
struct WineD3DContext *ctx = context_get_current();
|
struct wined3d_context *ctx = context_get_current();
|
||||||
if(pname == GL_FOG_COORDINATE_SOURCE_EXT) {
|
if(pname == GL_FOG_COORDINATE_SOURCE_EXT) {
|
||||||
ctx->gl_fog_source = (GLint) *param;
|
ctx->gl_fog_source = (GLint) *param;
|
||||||
if(*param == GL_FRAGMENT_DEPTH_EXT) {
|
if(*param == GL_FRAGMENT_DEPTH_EXT) {
|
||||||
|
@ -269,7 +269,7 @@ static void (WINE_GLAPI *old_fogcoord_glFogCoordfvEXT) (const GLfloat *f) = NULL
|
||||||
static void (WINE_GLAPI *old_fogcoord_glFogCoorddvEXT) (const GLdouble *f) = NULL;
|
static void (WINE_GLAPI *old_fogcoord_glFogCoorddvEXT) (const GLdouble *f) = NULL;
|
||||||
|
|
||||||
static void WINE_GLAPI wine_glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
|
static void WINE_GLAPI wine_glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
|
||||||
struct WineD3DContext *ctx = context_get_current();
|
struct wined3d_context *ctx = context_get_current();
|
||||||
if(ctx->gl_fog_source == GL_FOG_COORDINATE_EXT && ctx->fog_enabled) {
|
if(ctx->gl_fog_source == GL_FOG_COORDINATE_EXT && ctx->fog_enabled) {
|
||||||
GLfloat c[4] = {ctx->color[0], ctx->color[1], ctx->color[2], ctx->color[3]};
|
GLfloat c[4] = {ctx->color[0], ctx->color[1], ctx->color[2], ctx->color[3]};
|
||||||
GLfloat i;
|
GLfloat i;
|
||||||
|
@ -299,7 +299,7 @@ static void WINE_GLAPI wine_glVertex3fv(const GLfloat *pos) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WINE_GLAPI wine_glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a) {
|
static void WINE_GLAPI wine_glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a) {
|
||||||
struct WineD3DContext *ctx = context_get_current();
|
struct wined3d_context *ctx = context_get_current();
|
||||||
ctx->color[0] = r;
|
ctx->color[0] = r;
|
||||||
ctx->color[1] = g;
|
ctx->color[1] = g;
|
||||||
ctx->color[2] = b;
|
ctx->color[2] = b;
|
||||||
|
@ -327,7 +327,7 @@ static void WINE_GLAPI wine_glColor4ub(GLubyte r, GLubyte g, GLubyte b, GLubyte
|
||||||
* precision function
|
* precision function
|
||||||
*/
|
*/
|
||||||
static void WINE_GLAPI wine_glFogCoordfEXT(GLfloat f) {
|
static void WINE_GLAPI wine_glFogCoordfEXT(GLfloat f) {
|
||||||
struct WineD3DContext *ctx = context_get_current();
|
struct wined3d_context *ctx = context_get_current();
|
||||||
ctx->fog_coord_value = f;
|
ctx->fog_coord_value = f;
|
||||||
}
|
}
|
||||||
static void WINE_GLAPI wine_glFogCoorddEXT(GLdouble f) {
|
static void WINE_GLAPI wine_glFogCoorddEXT(GLdouble f) {
|
||||||
|
|
|
@ -32,7 +32,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
||||||
|
|
||||||
/* GL locking for state handlers is done by the caller. */
|
/* GL locking for state handlers is done by the caller. */
|
||||||
|
|
||||||
static void nvts_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void nvts_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
BOOL bumpmap = FALSE;
|
BOOL bumpmap = FALSE;
|
||||||
|
|
||||||
if(stage > 0 && (stateblock->textureState[stage - 1][WINED3DTSS_COLOROP] == WINED3DTOP_BUMPENVMAPLUMINANCE ||
|
if(stage > 0 && (stateblock->textureState[stage - 1][WINED3DTSS_COLOROP] == WINED3DTOP_BUMPENVMAPLUMINANCE ||
|
||||||
|
@ -452,7 +453,8 @@ void set_tex_op_nvrc(IWineD3DDevice *iface, BOOL is_alpha, int stage, WINED3DTEX
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void nvrc_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void nvrc_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
||||||
DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[stage];
|
DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[stage];
|
||||||
BOOL tex_used = stateblock->wineD3DDevice->fixed_function_usage_map & (1 << stage);
|
BOOL tex_used = stateblock->wineD3DDevice->fixed_function_usage_map & (1 << stage);
|
||||||
|
@ -544,7 +546,8 @@ static void nvrc_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void nvts_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void nvts_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
DWORD sampler = state - STATE_SAMPLER(0);
|
DWORD sampler = state - STATE_SAMPLER(0);
|
||||||
DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[sampler];
|
DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[sampler];
|
||||||
|
|
||||||
|
@ -559,7 +562,8 @@ static void nvts_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
|
||||||
nvts_activate_dimensions(sampler, stateblock, context);
|
nvts_activate_dimensions(sampler, stateblock, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void nvts_bumpenvmat(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void nvts_bumpenvmat(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
||||||
DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[stage + 1];
|
DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[stage + 1];
|
||||||
float mat[2][2];
|
float mat[2][2];
|
||||||
|
@ -586,7 +590,8 @@ static void nvts_bumpenvmat(DWORD state, IWineD3DStateBlockImpl *stateblock, Win
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void nvrc_texfactor(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void nvrc_texfactor(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
float col[4];
|
float col[4];
|
||||||
D3DCOLORTOGLFLOAT4(stateblock->renderState[WINED3DRS_TEXTUREFACTOR], col);
|
D3DCOLORTOGLFLOAT4(stateblock->renderState[WINED3DRS_TEXTUREFACTOR], col);
|
||||||
GL_EXTCALL(glCombinerParameterfvNV(GL_CONSTANT_COLOR0_NV, &col[0]));
|
GL_EXTCALL(glCombinerParameterfvNV(GL_CONSTANT_COLOR0_NV, &col[0]));
|
||||||
|
|
|
@ -457,7 +457,7 @@ static HRESULT WINAPI IWineD3DEventQueryImpl_Issue(IWineD3DQuery* iface, DWORD
|
||||||
if (dwIssueFlags & WINED3DISSUE_END)
|
if (dwIssueFlags & WINED3DISSUE_END)
|
||||||
{
|
{
|
||||||
struct wined3d_event_query *query = This->extendedData;
|
struct wined3d_event_query *query = This->extendedData;
|
||||||
struct WineD3DContext *context;
|
struct wined3d_context *context;
|
||||||
|
|
||||||
if (query->context)
|
if (query->context)
|
||||||
{
|
{
|
||||||
|
@ -514,7 +514,7 @@ static HRESULT WINAPI IWineD3DOcclusionQueryImpl_Issue(IWineD3DQuery* iface, D
|
||||||
if (GL_SUPPORT(ARB_OCCLUSION_QUERY))
|
if (GL_SUPPORT(ARB_OCCLUSION_QUERY))
|
||||||
{
|
{
|
||||||
struct wined3d_occlusion_query *query = This->extendedData;
|
struct wined3d_occlusion_query *query = This->extendedData;
|
||||||
struct WineD3DContext *context;
|
struct wined3d_context *context;
|
||||||
|
|
||||||
/* This is allowed according to msdn and our tests. Reset the query and restart */
|
/* This is allowed according to msdn and our tests. Reset the query and restart */
|
||||||
if (dwIssueFlags & WINED3DISSUE_BEGIN)
|
if (dwIssueFlags & WINED3DISSUE_BEGIN)
|
||||||
|
|
|
@ -38,9 +38,10 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_shader);
|
||||||
|
|
||||||
/* GL locking for state handlers is done by the caller. */
|
/* GL locking for state handlers is done by the caller. */
|
||||||
|
|
||||||
static void state_blendop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context);
|
static void state_blendop(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context);
|
||||||
|
|
||||||
static void state_nogl(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_nogl(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
/* Used for states which are not mapped to a gl state as-is, but used somehow different,
|
/* Used for states which are not mapped to a gl state as-is, but used somehow different,
|
||||||
* e.g as a parameter for drawing, or which are unimplemented in windows d3d
|
* e.g as a parameter for drawing, or which are unimplemented in windows d3d
|
||||||
*/
|
*/
|
||||||
|
@ -53,7 +54,8 @@ static void state_nogl(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DC
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_undefined(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_undefined(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
/* Print a WARN, this allows the stateblock code to loop over all states to generate a display
|
/* Print a WARN, this allows the stateblock code to loop over all states to generate a display
|
||||||
* list without causing confusing terminal output. Deliberately no special debug name here
|
* list without causing confusing terminal output. Deliberately no special debug name here
|
||||||
* because its undefined.
|
* because its undefined.
|
||||||
|
@ -61,7 +63,8 @@ static void state_undefined(DWORD state, IWineD3DStateBlockImpl *stateblock, Win
|
||||||
WARN("undefined state %d\n", state);
|
WARN("undefined state %d\n", state);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_fillmode(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_fillmode(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
WINED3DFILLMODE Value = stateblock->renderState[WINED3DRS_FILLMODE];
|
WINED3DFILLMODE Value = stateblock->renderState[WINED3DRS_FILLMODE];
|
||||||
|
|
||||||
switch(Value) {
|
switch(Value) {
|
||||||
|
@ -82,7 +85,8 @@ static void state_fillmode(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_lighting(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_lighting(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
/* Lighting is not enabled if transformed vertices are drawn
|
/* Lighting is not enabled if transformed vertices are drawn
|
||||||
* but lighting does not affect the stream sources, so it is not grouped for performance reasons.
|
* but lighting does not affect the stream sources, so it is not grouped for performance reasons.
|
||||||
* This state reads the decoded vertex declaration, so if it is dirty don't do anything. The
|
* This state reads the decoded vertex declaration, so if it is dirty don't do anything. The
|
||||||
|
@ -104,7 +108,8 @@ static void state_lighting(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_zenable(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_zenable(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
/* No z test without depth stencil buffers */
|
/* No z test without depth stencil buffers */
|
||||||
if(stateblock->wineD3DDevice->stencilBufferTarget == NULL) {
|
if(stateblock->wineD3DDevice->stencilBufferTarget == NULL) {
|
||||||
TRACE("No Z buffer - disabling depth test\n");
|
TRACE("No Z buffer - disabling depth test\n");
|
||||||
|
@ -132,7 +137,8 @@ static void state_zenable(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_cullmode(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_cullmode(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
/* glFrontFace() is set in context.c at context init and on an offscreen / onscreen rendering
|
/* glFrontFace() is set in context.c at context init and on an offscreen / onscreen rendering
|
||||||
* switch
|
* switch
|
||||||
*/
|
*/
|
||||||
|
@ -158,7 +164,8 @@ static void state_cullmode(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_shademode(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_shademode(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
switch ((WINED3DSHADEMODE) stateblock->renderState[WINED3DRS_SHADEMODE]) {
|
switch ((WINED3DSHADEMODE) stateblock->renderState[WINED3DRS_SHADEMODE]) {
|
||||||
case WINED3DSHADE_FLAT:
|
case WINED3DSHADE_FLAT:
|
||||||
glShadeModel(GL_FLAT);
|
glShadeModel(GL_FLAT);
|
||||||
|
@ -176,7 +183,8 @@ static void state_shademode(DWORD state, IWineD3DStateBlockImpl *stateblock, Win
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_ditherenable(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_ditherenable(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if (stateblock->renderState[WINED3DRS_DITHERENABLE]) {
|
if (stateblock->renderState[WINED3DRS_DITHERENABLE]) {
|
||||||
glEnable(GL_DITHER);
|
glEnable(GL_DITHER);
|
||||||
checkGLcall("glEnable GL_DITHER");
|
checkGLcall("glEnable GL_DITHER");
|
||||||
|
@ -186,7 +194,8 @@ static void state_ditherenable(DWORD state, IWineD3DStateBlockImpl *stateblock,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_zwritenable(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_zwritenable(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
/* TODO: Test if in d3d z writing is enabled even if ZENABLE is off. If yes,
|
/* TODO: Test if in d3d z writing is enabled even if ZENABLE is off. If yes,
|
||||||
* this has to be merged with ZENABLE and ZFUNC
|
* this has to be merged with ZENABLE and ZFUNC
|
||||||
*/
|
*/
|
||||||
|
@ -199,7 +208,8 @@ static void state_zwritenable(DWORD state, IWineD3DStateBlockImpl *stateblock, W
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_zfunc(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_zfunc(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
int glParm = CompareFunc(stateblock->renderState[WINED3DRS_ZFUNC]);
|
int glParm = CompareFunc(stateblock->renderState[WINED3DRS_ZFUNC]);
|
||||||
|
|
||||||
if(glParm) {
|
if(glParm) {
|
||||||
|
@ -222,7 +232,8 @@ static void state_zfunc(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_ambient(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_ambient(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
float col[4];
|
float col[4];
|
||||||
D3DCOLORTOGLFLOAT4(stateblock->renderState[WINED3DRS_AMBIENT], col);
|
D3DCOLORTOGLFLOAT4(stateblock->renderState[WINED3DRS_AMBIENT], col);
|
||||||
|
|
||||||
|
@ -231,7 +242,8 @@ static void state_ambient(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD
|
||||||
checkGLcall("glLightModel for MODEL_AMBIENT");
|
checkGLcall("glLightModel for MODEL_AMBIENT");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_blend(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_blend(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
int srcBlend = GL_ZERO;
|
int srcBlend = GL_ZERO;
|
||||||
int dstBlend = GL_ZERO;
|
int dstBlend = GL_ZERO;
|
||||||
IWineD3DSurfaceImpl *target = (IWineD3DSurfaceImpl *) stateblock->wineD3DDevice->render_targets[0];
|
IWineD3DSurfaceImpl *target = (IWineD3DSurfaceImpl *) stateblock->wineD3DDevice->render_targets[0];
|
||||||
|
@ -443,11 +455,13 @@ static void state_blend(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_blendfactor_w(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_blendfactor_w(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
WARN("Unsupported in local OpenGL implementation: glBlendColorEXT\n");
|
WARN("Unsupported in local OpenGL implementation: glBlendColorEXT\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_blendfactor(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_blendfactor(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
float col[4];
|
float col[4];
|
||||||
|
|
||||||
TRACE("Setting BlendFactor to %d\n", stateblock->renderState[WINED3DRS_BLENDFACTOR]);
|
TRACE("Setting BlendFactor to %d\n", stateblock->renderState[WINED3DRS_BLENDFACTOR]);
|
||||||
|
@ -456,7 +470,8 @@ static void state_blendfactor(DWORD state, IWineD3DStateBlockImpl *stateblock, W
|
||||||
checkGLcall("glBlendColor");
|
checkGLcall("glBlendColor");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_alpha(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_alpha(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
int glParm = 0;
|
int glParm = 0;
|
||||||
float ref;
|
float ref;
|
||||||
BOOL enable_ckey = FALSE;
|
BOOL enable_ckey = FALSE;
|
||||||
|
@ -521,7 +536,8 @@ static void state_alpha(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_clipping(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_clipping(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
DWORD enable = 0xFFFFFFFF;
|
DWORD enable = 0xFFFFFFFF;
|
||||||
DWORD disable = 0x00000000;
|
DWORD disable = 0x00000000;
|
||||||
|
|
||||||
|
@ -589,11 +605,13 @@ static void state_clipping(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_blendop_w(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_blendop_w(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
WARN("Unsupported in local OpenGL implementation: glBlendEquation\n");
|
WARN("Unsupported in local OpenGL implementation: glBlendEquation\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_blendop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_blendop(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
int blendEquation = GL_FUNC_ADD;
|
int blendEquation = GL_FUNC_ADD;
|
||||||
int blendEquationAlpha = GL_FUNC_ADD;
|
int blendEquationAlpha = GL_FUNC_ADD;
|
||||||
|
|
||||||
|
@ -634,8 +652,8 @@ static void state_blendop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void state_specularenable(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
state_specularenable(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
{
|
||||||
/* Originally this used glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL,GL_SEPARATE_SPECULAR_COLOR)
|
/* Originally this used glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL,GL_SEPARATE_SPECULAR_COLOR)
|
||||||
* and (GL_LIGHT_MODEL_COLOR_CONTROL,GL_SINGLE_COLOR) to swap between enabled/disabled
|
* and (GL_LIGHT_MODEL_COLOR_CONTROL,GL_SINGLE_COLOR) to swap between enabled/disabled
|
||||||
* specular color. This is wrong:
|
* specular color. This is wrong:
|
||||||
|
@ -734,7 +752,8 @@ state_specularenable(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCon
|
||||||
checkGLcall("glMaterialfv(GL_EMISSION)");
|
checkGLcall("glMaterialfv(GL_EMISSION)");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_texfactor(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_texfactor(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
/* Note the texture color applies to all textures whereas
|
/* Note the texture color applies to all textures whereas
|
||||||
|
@ -768,8 +787,8 @@ renderstate_stencil_twosided(IWineD3DStateBlockImpl *stateblock, GLint face, GLi
|
||||||
checkGLcall("glStencilOp(...)");
|
checkGLcall("glStencilOp(...)");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void state_stencil(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
state_stencil(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
{
|
||||||
DWORD onesided_enable = FALSE;
|
DWORD onesided_enable = FALSE;
|
||||||
DWORD twosided_enable = FALSE;
|
DWORD twosided_enable = FALSE;
|
||||||
GLint func = GL_ALWAYS;
|
GLint func = GL_ALWAYS;
|
||||||
|
@ -858,7 +877,8 @@ state_stencil(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *c
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_stencilwrite2s(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_stencilwrite2s(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
DWORD mask;
|
DWORD mask;
|
||||||
|
|
||||||
if(stateblock->wineD3DDevice->stencilBufferTarget) {
|
if(stateblock->wineD3DDevice->stencilBufferTarget) {
|
||||||
|
@ -876,7 +896,8 @@ static void state_stencilwrite2s(DWORD state, IWineD3DStateBlockImpl *stateblock
|
||||||
glStencilMask(mask);
|
glStencilMask(mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_stencilwrite(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_stencilwrite(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
DWORD mask;
|
DWORD mask;
|
||||||
|
|
||||||
if(stateblock->wineD3DDevice->stencilBufferTarget) {
|
if(stateblock->wineD3DDevice->stencilBufferTarget) {
|
||||||
|
@ -889,7 +910,8 @@ static void state_stencilwrite(DWORD state, IWineD3DStateBlockImpl *stateblock,
|
||||||
checkGLcall("glStencilMask");
|
checkGLcall("glStencilMask");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_fog_vertexpart(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_fog_vertexpart(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
|
|
||||||
TRACE("state %#x, stateblock %p, context %p\n", state, stateblock, context);
|
TRACE("state %#x, stateblock %p, context %p\n", state, stateblock, context);
|
||||||
|
|
||||||
|
@ -926,7 +948,8 @@ static void state_fog_vertexpart(DWORD state, IWineD3DStateBlockImpl *stateblock
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void state_fogstartend(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
void state_fogstartend(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
float fogstart, fogend;
|
float fogstart, fogend;
|
||||||
union {
|
union {
|
||||||
DWORD d;
|
DWORD d;
|
||||||
|
@ -974,7 +997,8 @@ void state_fogstartend(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DC
|
||||||
TRACE("Fog End == %f\n", fogend);
|
TRACE("Fog End == %f\n", fogend);
|
||||||
}
|
}
|
||||||
|
|
||||||
void state_fog_fragpart(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
void state_fog_fragpart(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
enum fogsource new_source;
|
enum fogsource new_source;
|
||||||
|
|
||||||
TRACE("state %#x, stateblock %p, context %p\n", state, stateblock, context);
|
TRACE("state %#x, stateblock %p, context %p\n", state, stateblock, context);
|
||||||
|
@ -1115,13 +1139,15 @@ void state_fog_fragpart(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_rangefog_w(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_rangefog_w(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->renderState[WINED3DRS_RANGEFOGENABLE]) {
|
if(stateblock->renderState[WINED3DRS_RANGEFOGENABLE]) {
|
||||||
WARN("Range fog enabled, but not supported by this opengl implementation\n");
|
WARN("Range fog enabled, but not supported by this opengl implementation\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_rangefog(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_rangefog(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->renderState[WINED3DRS_RANGEFOGENABLE]) {
|
if(stateblock->renderState[WINED3DRS_RANGEFOGENABLE]) {
|
||||||
glFogi(GL_FOG_DISTANCE_MODE_NV, GL_EYE_RADIAL_NV);
|
glFogi(GL_FOG_DISTANCE_MODE_NV, GL_EYE_RADIAL_NV);
|
||||||
checkGLcall("glFogi(GL_FOG_DISTANCE_MODE_NV, GL_EYE_RADIAL_NV)");
|
checkGLcall("glFogi(GL_FOG_DISTANCE_MODE_NV, GL_EYE_RADIAL_NV)");
|
||||||
|
@ -1131,14 +1157,16 @@ static void state_rangefog(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void state_fogcolor(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
void state_fogcolor(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
float col[4];
|
float col[4];
|
||||||
D3DCOLORTOGLFLOAT4(stateblock->renderState[WINED3DRS_FOGCOLOR], col);
|
D3DCOLORTOGLFLOAT4(stateblock->renderState[WINED3DRS_FOGCOLOR], col);
|
||||||
glFogfv(GL_FOG_COLOR, &col[0]);
|
glFogfv(GL_FOG_COLOR, &col[0]);
|
||||||
checkGLcall("glFog GL_FOG_COLOR");
|
checkGLcall("glFog GL_FOG_COLOR");
|
||||||
}
|
}
|
||||||
|
|
||||||
void state_fogdensity(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
void state_fogdensity(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
union {
|
union {
|
||||||
DWORD d;
|
DWORD d;
|
||||||
float f;
|
float f;
|
||||||
|
@ -1148,7 +1176,8 @@ void state_fogdensity(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo
|
||||||
checkGLcall("glFogf(GL_FOG_DENSITY, (float) Value)");
|
checkGLcall("glFogf(GL_FOG_DENSITY, (float) Value)");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_colormat(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_colormat(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
|
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
|
||||||
GLenum Parm = 0;
|
GLenum Parm = 0;
|
||||||
const struct wined3d_stream_info_element *diffuse = &device->strided_streams.elements[WINED3D_FFP_DIFFUSE];
|
const struct wined3d_stream_info_element *diffuse = &device->strided_streams.elements[WINED3D_FFP_DIFFUSE];
|
||||||
|
@ -1260,7 +1289,8 @@ static void state_colormat(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
|
||||||
context->tracking_parm = Parm;
|
context->tracking_parm = Parm;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_linepattern(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_linepattern(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
union {
|
union {
|
||||||
DWORD d;
|
DWORD d;
|
||||||
WINED3DLINEPATTERN lp;
|
WINED3DLINEPATTERN lp;
|
||||||
|
@ -1280,7 +1310,8 @@ static void state_linepattern(DWORD state, IWineD3DStateBlockImpl *stateblock, W
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_zbias(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_zbias(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
union {
|
union {
|
||||||
DWORD d;
|
DWORD d;
|
||||||
float f;
|
float f;
|
||||||
|
@ -1308,7 +1339,8 @@ static void state_zbias(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void state_normalize(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_normalize(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(isStateDirty(context, STATE_VDECL)) {
|
if(isStateDirty(context, STATE_VDECL)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1328,7 +1360,8 @@ static void state_normalize(DWORD state, IWineD3DStateBlockImpl *stateblock, Win
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_psizemin_w(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_psizemin_w(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
union {
|
union {
|
||||||
DWORD d;
|
DWORD d;
|
||||||
float f;
|
float f;
|
||||||
|
@ -1347,7 +1380,8 @@ static void state_psizemin_w(DWORD state, IWineD3DStateBlockImpl *stateblock, Wi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_psizemin_ext(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_psizemin_ext(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
union {
|
union {
|
||||||
DWORD d;
|
DWORD d;
|
||||||
float f;
|
float f;
|
||||||
|
@ -1367,7 +1401,8 @@ static void state_psizemin_ext(DWORD state, IWineD3DStateBlockImpl *stateblock,
|
||||||
checkGLcall("glPointParameterfEXT(...)");
|
checkGLcall("glPointParameterfEXT(...)");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_psizemin_arb(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_psizemin_arb(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
union {
|
union {
|
||||||
DWORD d;
|
DWORD d;
|
||||||
float f;
|
float f;
|
||||||
|
@ -1387,7 +1422,8 @@ static void state_psizemin_arb(DWORD state, IWineD3DStateBlockImpl *stateblock,
|
||||||
checkGLcall("glPointParameterfARB(...)");
|
checkGLcall("glPointParameterfARB(...)");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_pscale(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_pscale(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
/* TODO: Group this with the viewport */
|
/* TODO: Group this with the viewport */
|
||||||
/*
|
/*
|
||||||
* POINTSCALEENABLE controls how point size value is treated. If set to
|
* POINTSCALEENABLE controls how point size value is treated. If set to
|
||||||
|
@ -1457,7 +1493,8 @@ static void state_pscale(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3
|
||||||
checkGLcall("glPointSize(...);");
|
checkGLcall("glPointSize(...);");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_colorwrite(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_colorwrite(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
DWORD Value = stateblock->renderState[WINED3DRS_COLORWRITEENABLE];
|
DWORD Value = stateblock->renderState[WINED3DRS_COLORWRITEENABLE];
|
||||||
|
|
||||||
TRACE("Color mask: r(%d) g(%d) b(%d) a(%d)\n",
|
TRACE("Color mask: r(%d) g(%d) b(%d) a(%d)\n",
|
||||||
|
@ -1482,7 +1519,8 @@ static void state_colorwrite(DWORD state, IWineD3DStateBlockImpl *stateblock, Wi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_localviewer(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_localviewer(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->renderState[WINED3DRS_LOCALVIEWER]) {
|
if(stateblock->renderState[WINED3DRS_LOCALVIEWER]) {
|
||||||
glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1);
|
glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1);
|
||||||
checkGLcall("glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1)");
|
checkGLcall("glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1)");
|
||||||
|
@ -1492,7 +1530,8 @@ static void state_localviewer(DWORD state, IWineD3DStateBlockImpl *stateblock, W
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_lastpixel(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_lastpixel(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->renderState[WINED3DRS_LASTPIXEL]) {
|
if(stateblock->renderState[WINED3DRS_LASTPIXEL]) {
|
||||||
TRACE("Last Pixel Drawing Enabled\n");
|
TRACE("Last Pixel Drawing Enabled\n");
|
||||||
} else {
|
} else {
|
||||||
|
@ -1506,7 +1545,8 @@ static void state_lastpixel(DWORD state, IWineD3DStateBlockImpl *stateblock, Win
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_pointsprite_w(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_pointsprite_w(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
BOOL warned = FALSE;
|
BOOL warned = FALSE;
|
||||||
/* TODO: NV_POINT_SPRITE */
|
/* TODO: NV_POINT_SPRITE */
|
||||||
if (!warned && stateblock->renderState[WINED3DRS_POINTSPRITEENABLE]) {
|
if (!warned && stateblock->renderState[WINED3DRS_POINTSPRITEENABLE]) {
|
||||||
|
@ -1516,7 +1556,8 @@ static void state_pointsprite_w(DWORD state, IWineD3DStateBlockImpl *stateblock,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_pointsprite(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_pointsprite(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if (stateblock->renderState[WINED3DRS_POINTSPRITEENABLE]) {
|
if (stateblock->renderState[WINED3DRS_POINTSPRITEENABLE]) {
|
||||||
BOOL warned = FALSE;
|
BOOL warned = FALSE;
|
||||||
if(GL_LIMITS(point_sprite_units) < GL_LIMITS(textures) && !warned) {
|
if(GL_LIMITS(point_sprite_units) < GL_LIMITS(textures) && !warned) {
|
||||||
|
@ -1534,7 +1575,8 @@ static void state_pointsprite(DWORD state, IWineD3DStateBlockImpl *stateblock, W
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_wrap(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_wrap(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
/**
|
/**
|
||||||
http://www.cosc.brocku.ca/Offerings/3P98/course/lectures/texture/
|
http://www.cosc.brocku.ca/Offerings/3P98/course/lectures/texture/
|
||||||
http://www.gamedev.net/reference/programming/features/rendererdll3/page2.asp
|
http://www.gamedev.net/reference/programming/features/rendererdll3/page2.asp
|
||||||
|
@ -1564,13 +1606,15 @@ static void state_wrap(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DC
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_msaa_w(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_msaa_w(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->renderState[WINED3DRS_MULTISAMPLEANTIALIAS]) {
|
if(stateblock->renderState[WINED3DRS_MULTISAMPLEANTIALIAS]) {
|
||||||
WARN("Multisample antialiasing not supported by gl\n");
|
WARN("Multisample antialiasing not supported by gl\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_msaa(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_msaa(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->renderState[WINED3DRS_MULTISAMPLEANTIALIAS]) {
|
if(stateblock->renderState[WINED3DRS_MULTISAMPLEANTIALIAS]) {
|
||||||
glEnable(GL_MULTISAMPLE_ARB);
|
glEnable(GL_MULTISAMPLE_ARB);
|
||||||
checkGLcall("glEnable(GL_MULTISAMPLE_ARB)");
|
checkGLcall("glEnable(GL_MULTISAMPLE_ARB)");
|
||||||
|
@ -1580,7 +1624,8 @@ static void state_msaa(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DC
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_scissor(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_scissor(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->renderState[WINED3DRS_SCISSORTESTENABLE]) {
|
if(stateblock->renderState[WINED3DRS_SCISSORTESTENABLE]) {
|
||||||
glEnable(GL_SCISSOR_TEST);
|
glEnable(GL_SCISSOR_TEST);
|
||||||
checkGLcall("glEnable(GL_SCISSOR_TEST)");
|
checkGLcall("glEnable(GL_SCISSOR_TEST)");
|
||||||
|
@ -1590,7 +1635,8 @@ static void state_scissor(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_depthbias(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_depthbias(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
union {
|
union {
|
||||||
DWORD d;
|
DWORD d;
|
||||||
float f;
|
float f;
|
||||||
|
@ -1609,7 +1655,8 @@ static void state_depthbias(DWORD state, IWineD3DStateBlockImpl *stateblock, Win
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_perspective(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_perspective(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if (stateblock->renderState[WINED3DRS_TEXTUREPERSPECTIVE]) {
|
if (stateblock->renderState[WINED3DRS_TEXTUREPERSPECTIVE]) {
|
||||||
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
|
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
|
||||||
checkGLcall("glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST)");
|
checkGLcall("glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST)");
|
||||||
|
@ -1619,31 +1666,36 @@ static void state_perspective(DWORD state, IWineD3DStateBlockImpl *stateblock, W
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_stippledalpha(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_stippledalpha(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
TRACE("Stub\n");
|
TRACE("Stub\n");
|
||||||
if (stateblock->renderState[WINED3DRS_STIPPLEDALPHA])
|
if (stateblock->renderState[WINED3DRS_STIPPLEDALPHA])
|
||||||
FIXME(" Stippled Alpha not supported yet.\n");
|
FIXME(" Stippled Alpha not supported yet.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_antialias(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_antialias(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
TRACE("Stub\n");
|
TRACE("Stub\n");
|
||||||
if (stateblock->renderState[WINED3DRS_ANTIALIAS])
|
if (stateblock->renderState[WINED3DRS_ANTIALIAS])
|
||||||
FIXME(" Antialias not supported yet.\n");
|
FIXME(" Antialias not supported yet.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_multisampmask(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_multisampmask(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
TRACE("Stub\n");
|
TRACE("Stub\n");
|
||||||
if (stateblock->renderState[WINED3DRS_MULTISAMPLEMASK] != 0xFFFFFFFF)
|
if (stateblock->renderState[WINED3DRS_MULTISAMPLEMASK] != 0xFFFFFFFF)
|
||||||
FIXME("(WINED3DRS_MULTISAMPLEMASK,%d) not yet implemented\n", stateblock->renderState[WINED3DRS_MULTISAMPLEMASK]);
|
FIXME("(WINED3DRS_MULTISAMPLEMASK,%d) not yet implemented\n", stateblock->renderState[WINED3DRS_MULTISAMPLEMASK]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_patchedgestyle(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_patchedgestyle(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
TRACE("Stub\n");
|
TRACE("Stub\n");
|
||||||
if (stateblock->renderState[WINED3DRS_PATCHEDGESTYLE] != WINED3DPATCHEDGE_DISCRETE)
|
if (stateblock->renderState[WINED3DRS_PATCHEDGESTYLE] != WINED3DPATCHEDGE_DISCRETE)
|
||||||
FIXME("(WINED3DRS_PATCHEDGESTYLE,%d) not yet implemented\n", stateblock->renderState[WINED3DRS_PATCHEDGESTYLE]);
|
FIXME("(WINED3DRS_PATCHEDGESTYLE,%d) not yet implemented\n", stateblock->renderState[WINED3DRS_PATCHEDGESTYLE]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_patchsegments(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_patchsegments(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
union {
|
union {
|
||||||
DWORD d;
|
DWORD d;
|
||||||
float f;
|
float f;
|
||||||
|
@ -1663,109 +1715,127 @@ static void state_patchsegments(DWORD state, IWineD3DStateBlockImpl *stateblock,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_positiondegree(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_positiondegree(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
TRACE("Stub\n");
|
TRACE("Stub\n");
|
||||||
if (stateblock->renderState[WINED3DRS_POSITIONDEGREE] != WINED3DDEGREE_CUBIC)
|
if (stateblock->renderState[WINED3DRS_POSITIONDEGREE] != WINED3DDEGREE_CUBIC)
|
||||||
FIXME("(WINED3DRS_POSITIONDEGREE,%d) not yet implemented\n", stateblock->renderState[WINED3DRS_POSITIONDEGREE]);
|
FIXME("(WINED3DRS_POSITIONDEGREE,%d) not yet implemented\n", stateblock->renderState[WINED3DRS_POSITIONDEGREE]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_normaldegree(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_normaldegree(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
TRACE("Stub\n");
|
TRACE("Stub\n");
|
||||||
if (stateblock->renderState[WINED3DRS_NORMALDEGREE] != WINED3DDEGREE_LINEAR)
|
if (stateblock->renderState[WINED3DRS_NORMALDEGREE] != WINED3DDEGREE_LINEAR)
|
||||||
FIXME("(WINED3DRS_NORMALDEGREE,%d) not yet implemented\n", stateblock->renderState[WINED3DRS_NORMALDEGREE]);
|
FIXME("(WINED3DRS_NORMALDEGREE,%d) not yet implemented\n", stateblock->renderState[WINED3DRS_NORMALDEGREE]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_tessellation(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_tessellation(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
TRACE("Stub\n");
|
TRACE("Stub\n");
|
||||||
if(stateblock->renderState[WINED3DRS_ENABLEADAPTIVETESSELLATION])
|
if(stateblock->renderState[WINED3DRS_ENABLEADAPTIVETESSELLATION])
|
||||||
FIXME("(WINED3DRS_ENABLEADAPTIVETESSELLATION,%d) not yet implemented\n", stateblock->renderState[WINED3DRS_ENABLEADAPTIVETESSELLATION]);
|
FIXME("(WINED3DRS_ENABLEADAPTIVETESSELLATION,%d) not yet implemented\n", stateblock->renderState[WINED3DRS_ENABLEADAPTIVETESSELLATION]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_wrapu(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_wrapu(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->renderState[WINED3DRS_WRAPU]) {
|
if(stateblock->renderState[WINED3DRS_WRAPU]) {
|
||||||
FIXME("Render state WINED3DRS_WRAPU not implemented yet\n");
|
FIXME("Render state WINED3DRS_WRAPU not implemented yet\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_wrapv(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_wrapv(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->renderState[WINED3DRS_WRAPV]) {
|
if(stateblock->renderState[WINED3DRS_WRAPV]) {
|
||||||
FIXME("Render state WINED3DRS_WRAPV not implemented yet\n");
|
FIXME("Render state WINED3DRS_WRAPV not implemented yet\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_monoenable(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_monoenable(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->renderState[WINED3DRS_MONOENABLE]) {
|
if(stateblock->renderState[WINED3DRS_MONOENABLE]) {
|
||||||
FIXME("Render state WINED3DRS_MONOENABLE not implemented yet\n");
|
FIXME("Render state WINED3DRS_MONOENABLE not implemented yet\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_rop2(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_rop2(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->renderState[WINED3DRS_ROP2]) {
|
if(stateblock->renderState[WINED3DRS_ROP2]) {
|
||||||
FIXME("Render state WINED3DRS_ROP2 not implemented yet\n");
|
FIXME("Render state WINED3DRS_ROP2 not implemented yet\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_planemask(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_planemask(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->renderState[WINED3DRS_PLANEMASK]) {
|
if(stateblock->renderState[WINED3DRS_PLANEMASK]) {
|
||||||
FIXME("Render state WINED3DRS_PLANEMASK not implemented yet\n");
|
FIXME("Render state WINED3DRS_PLANEMASK not implemented yet\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_subpixel(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_subpixel(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->renderState[WINED3DRS_SUBPIXEL]) {
|
if(stateblock->renderState[WINED3DRS_SUBPIXEL]) {
|
||||||
FIXME("Render state WINED3DRS_SUBPIXEL not implemented yet\n");
|
FIXME("Render state WINED3DRS_SUBPIXEL not implemented yet\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_subpixelx(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_subpixelx(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->renderState[WINED3DRS_SUBPIXELX]) {
|
if(stateblock->renderState[WINED3DRS_SUBPIXELX]) {
|
||||||
FIXME("Render state WINED3DRS_SUBPIXELX not implemented yet\n");
|
FIXME("Render state WINED3DRS_SUBPIXELX not implemented yet\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_stippleenable(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_stippleenable(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->renderState[WINED3DRS_STIPPLEENABLE]) {
|
if(stateblock->renderState[WINED3DRS_STIPPLEENABLE]) {
|
||||||
FIXME("Render state WINED3DRS_STIPPLEENABLE not implemented yet\n");
|
FIXME("Render state WINED3DRS_STIPPLEENABLE not implemented yet\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_bordercolor(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_bordercolor(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->renderState[WINED3DRS_BORDERCOLOR]) {
|
if(stateblock->renderState[WINED3DRS_BORDERCOLOR]) {
|
||||||
FIXME("Render state WINED3DRS_BORDERCOLOR not implemented yet\n");
|
FIXME("Render state WINED3DRS_BORDERCOLOR not implemented yet\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_mipmaplodbias(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_mipmaplodbias(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->renderState[WINED3DRS_MIPMAPLODBIAS]) {
|
if(stateblock->renderState[WINED3DRS_MIPMAPLODBIAS]) {
|
||||||
FIXME("Render state WINED3DRS_MIPMAPLODBIAS not implemented yet\n");
|
FIXME("Render state WINED3DRS_MIPMAPLODBIAS not implemented yet\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_anisotropy(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_anisotropy(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->renderState[WINED3DRS_ANISOTROPY]) {
|
if(stateblock->renderState[WINED3DRS_ANISOTROPY]) {
|
||||||
FIXME("Render state WINED3DRS_ANISOTROPY not implemented yet\n");
|
FIXME("Render state WINED3DRS_ANISOTROPY not implemented yet\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_flushbatch(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_flushbatch(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->renderState[WINED3DRS_FLUSHBATCH]) {
|
if(stateblock->renderState[WINED3DRS_FLUSHBATCH]) {
|
||||||
FIXME("Render state WINED3DRS_FLUSHBATCH not implemented yet\n");
|
FIXME("Render state WINED3DRS_FLUSHBATCH not implemented yet\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_translucentsi(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_translucentsi(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->renderState[WINED3DRS_TRANSLUCENTSORTINDEPENDENT]) {
|
if(stateblock->renderState[WINED3DRS_TRANSLUCENTSORTINDEPENDENT]) {
|
||||||
FIXME("Render state WINED3DRS_TRANSLUCENTSORTINDEPENDENT not implemented yet\n");
|
FIXME("Render state WINED3DRS_TRANSLUCENTSORTINDEPENDENT not implemented yet\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_extents(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_extents(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->renderState[WINED3DRS_EXTENTS]) {
|
if(stateblock->renderState[WINED3DRS_EXTENTS]) {
|
||||||
FIXME("Render state WINED3DRS_EXTENTS not implemented yet\n");
|
FIXME("Render state WINED3DRS_EXTENTS not implemented yet\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_ckeyblend(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_ckeyblend(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->renderState[WINED3DRS_COLORKEYBLENDENABLE]) {
|
if(stateblock->renderState[WINED3DRS_COLORKEYBLENDENABLE]) {
|
||||||
FIXME("Render state WINED3DRS_COLORKEYBLENDENABLE not implemented yet\n");
|
FIXME("Render state WINED3DRS_COLORKEYBLENDENABLE not implemented yet\n");
|
||||||
}
|
}
|
||||||
|
@ -2844,7 +2914,8 @@ static void set_tex_op(IWineD3DDevice *iface, BOOL isAlpha, int Stage, WINED3DTE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void tex_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void tex_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
||||||
DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[stage];
|
DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[stage];
|
||||||
BOOL tex_used = stateblock->wineD3DDevice->fixed_function_usage_map & (1 << stage);
|
BOOL tex_used = stateblock->wineD3DDevice->fixed_function_usage_map & (1 << stage);
|
||||||
|
@ -2902,7 +2973,8 @@ static void tex_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
|
||||||
stateblock->textureState[stage][WINED3DTSS_COLORARG0]);
|
stateblock->textureState[stage][WINED3DTSS_COLORARG0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tex_alphaop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
void tex_alphaop(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
||||||
DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[stage];
|
DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[stage];
|
||||||
BOOL tex_used = stateblock->wineD3DDevice->fixed_function_usage_map & (1 << stage);
|
BOOL tex_used = stateblock->wineD3DDevice->fixed_function_usage_map & (1 << stage);
|
||||||
|
@ -3001,7 +3073,8 @@ void tex_alphaop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void transform_texture(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void transform_texture(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
DWORD texUnit = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
DWORD texUnit = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
||||||
DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[texUnit];
|
DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[texUnit];
|
||||||
BOOL generated;
|
BOOL generated;
|
||||||
|
@ -3102,7 +3175,8 @@ static void loadTexCoords(IWineD3DStateBlockImpl *stateblock, const struct wined
|
||||||
checkGLcall("loadTexCoords");
|
checkGLcall("loadTexCoords");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tex_coordindex(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void tex_coordindex(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
||||||
DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[stage];
|
DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[stage];
|
||||||
static const GLfloat s_plane[] = { 1.0f, 0.0f, 0.0f, 0.0f };
|
static const GLfloat s_plane[] = { 1.0f, 0.0f, 0.0f, 0.0f };
|
||||||
|
@ -3275,7 +3349,8 @@ static void tex_coordindex(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void shaderconstant(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void shaderconstant(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
|
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
|
||||||
|
|
||||||
/* Vertex and pixel shader states will call a shader upload, don't do anything as long one of them
|
/* Vertex and pixel shader states will call a shader upload, don't do anything as long one of them
|
||||||
|
@ -3289,7 +3364,8 @@ static void shaderconstant(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
|
||||||
device->shader_backend->shader_load_constants((IWineD3DDevice *)device, use_ps(stateblock), use_vs(stateblock));
|
device->shader_backend->shader_load_constants((IWineD3DDevice *)device, use_ps(stateblock), use_vs(stateblock));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tex_bumpenvlscale(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void tex_bumpenvlscale(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
||||||
|
|
||||||
if(stateblock->pixelShader && stage != 0 &&
|
if(stateblock->pixelShader && stage != 0 &&
|
||||||
|
@ -3304,7 +3380,8 @@ static void tex_bumpenvlscale(DWORD state, IWineD3DStateBlockImpl *stateblock, W
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sampler_texmatrix(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void sampler_texmatrix(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
const DWORD sampler = state - STATE_SAMPLER(0);
|
const DWORD sampler = state - STATE_SAMPLER(0);
|
||||||
IWineD3DBaseTexture *texture = stateblock->textures[sampler];
|
IWineD3DBaseTexture *texture = stateblock->textures[sampler];
|
||||||
|
|
||||||
|
@ -3330,7 +3407,8 @@ static void sampler_texmatrix(DWORD state, IWineD3DStateBlockImpl *stateblock, W
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sampler(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void sampler(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
DWORD sampler = state - STATE_SAMPLER(0);
|
DWORD sampler = state - STATE_SAMPLER(0);
|
||||||
DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[sampler];
|
DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[sampler];
|
||||||
union {
|
union {
|
||||||
|
@ -3402,7 +3480,8 @@ static void sampler(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCont
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void apply_pixelshader(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
void apply_pixelshader(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
|
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
|
||||||
BOOL use_pshader = use_ps(stateblock);
|
BOOL use_pshader = use_ps(stateblock);
|
||||||
BOOL use_vshader = use_vs(stateblock);
|
BOOL use_vshader = use_vs(stateblock);
|
||||||
|
@ -3447,7 +3526,8 @@ void apply_pixelshader(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DC
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void shader_bumpenvmat(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void shader_bumpenvmat(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
|
||||||
if(stateblock->pixelShader && stage != 0 &&
|
if(stateblock->pixelShader && stage != 0 &&
|
||||||
((IWineD3DPixelShaderImpl *) stateblock->pixelShader)->baseShader.reg_maps.bumpmat[stage]) {
|
((IWineD3DPixelShaderImpl *) stateblock->pixelShader)->baseShader.reg_maps.bumpmat[stage]) {
|
||||||
|
@ -3461,7 +3541,8 @@ static void shader_bumpenvmat(DWORD state, IWineD3DStateBlockImpl *stateblock, W
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void transform_world(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void transform_world(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
/* This function is called by transform_view below if the view matrix was changed too
|
/* This function is called by transform_view below if the view matrix was changed too
|
||||||
*
|
*
|
||||||
* Deliberately no check if the vertex declaration is dirty because the vdecl state
|
* Deliberately no check if the vertex declaration is dirty because the vdecl state
|
||||||
|
@ -3489,7 +3570,8 @@ static void transform_world(DWORD state, IWineD3DStateBlockImpl *stateblock, Win
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void clipplane(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void clipplane(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
UINT index = state - STATE_CLIPPLANE(0);
|
UINT index = state - STATE_CLIPPLANE(0);
|
||||||
|
|
||||||
if(isStateDirty(context, STATE_TRANSFORM(WINED3DTS_VIEW)) || index >= GL_LIMITS(clipplanes)) {
|
if(isStateDirty(context, STATE_TRANSFORM(WINED3DTS_VIEW)) || index >= GL_LIMITS(clipplanes)) {
|
||||||
|
@ -3525,7 +3607,8 @@ static void clipplane(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void transform_worldex(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void transform_worldex(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
UINT matrix = state - STATE_TRANSFORM(WINED3DTS_WORLDMATRIX(0));
|
UINT matrix = state - STATE_TRANSFORM(WINED3DTS_WORLDMATRIX(0));
|
||||||
GLenum glMat;
|
GLenum glMat;
|
||||||
TRACE("Setting world matrix %d\n", matrix);
|
TRACE("Setting world matrix %d\n", matrix);
|
||||||
|
@ -3564,7 +3647,8 @@ static void transform_worldex(DWORD state, IWineD3DStateBlockImpl *stateblock, W
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_vertexblend_w(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_vertexblend_w(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
static BOOL once = FALSE;
|
static BOOL once = FALSE;
|
||||||
|
|
||||||
switch(stateblock->renderState[WINED3DRS_VERTEXBLEND]) {
|
switch(stateblock->renderState[WINED3DRS_VERTEXBLEND]) {
|
||||||
|
@ -3583,7 +3667,8 @@ static void state_vertexblend_w(DWORD state, IWineD3DStateBlockImpl *stateblock,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void state_vertexblend(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void state_vertexblend(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
WINED3DVERTEXBLENDFLAGS val = stateblock->renderState[WINED3DRS_VERTEXBLEND];
|
WINED3DVERTEXBLENDFLAGS val = stateblock->renderState[WINED3DRS_VERTEXBLEND];
|
||||||
|
|
||||||
switch(val) {
|
switch(val) {
|
||||||
|
@ -3625,7 +3710,8 @@ static void state_vertexblend(DWORD state, IWineD3DStateBlockImpl *stateblock, W
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void transform_view(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void transform_view(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
unsigned int k;
|
unsigned int k;
|
||||||
|
|
||||||
/* If we are changing the View matrix, reset the light and clipping planes to the new view
|
/* If we are changing the View matrix, reset the light and clipping planes to the new view
|
||||||
|
@ -3682,7 +3768,8 @@ static void transform_view(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void transform_projection(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void transform_projection(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
checkGLcall("glMatrixMode(GL_PROJECTION)");
|
checkGLcall("glMatrixMode(GL_PROJECTION)");
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
|
@ -3825,7 +3912,7 @@ static inline void unloadVertexData(IWineD3DStateBlockImpl *stateblock) {
|
||||||
unloadTexCoords(stateblock);
|
unloadTexCoords(stateblock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void unload_numbered_array(IWineD3DStateBlockImpl *stateblock, WineD3DContext *context, int i)
|
static inline void unload_numbered_array(IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context, int i)
|
||||||
{
|
{
|
||||||
GL_EXTCALL(glDisableVertexAttribArrayARB(i));
|
GL_EXTCALL(glDisableVertexAttribArrayARB(i));
|
||||||
checkGLcall("glDisableVertexAttribArrayARB(reg)");
|
checkGLcall("glDisableVertexAttribArrayARB(reg)");
|
||||||
|
@ -3836,7 +3923,7 @@ static inline void unload_numbered_array(IWineD3DStateBlockImpl *stateblock, Win
|
||||||
/* This should match any arrays loaded in loadNumberedArrays
|
/* This should match any arrays loaded in loadNumberedArrays
|
||||||
* TODO: Only load / unload arrays if we have to.
|
* TODO: Only load / unload arrays if we have to.
|
||||||
*/
|
*/
|
||||||
static inline void unloadNumberedArrays(IWineD3DStateBlockImpl *stateblock, WineD3DContext *context)
|
static inline void unloadNumberedArrays(IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
{
|
{
|
||||||
/* disable any attribs (this is the same for both GLSL and ARB modes) */
|
/* disable any attribs (this is the same for both GLSL and ARB modes) */
|
||||||
GLint maxAttribs = 16;
|
GLint maxAttribs = 16;
|
||||||
|
@ -3853,7 +3940,7 @@ static inline void unloadNumberedArrays(IWineD3DStateBlockImpl *stateblock, Wine
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void loadNumberedArrays(IWineD3DStateBlockImpl *stateblock,
|
static inline void loadNumberedArrays(IWineD3DStateBlockImpl *stateblock,
|
||||||
const struct wined3d_stream_info *stream_info, WineD3DContext *context)
|
const struct wined3d_stream_info *stream_info, struct wined3d_context *context)
|
||||||
{
|
{
|
||||||
GLuint curVBO = GL_SUPPORT(ARB_VERTEX_BUFFER_OBJECT) ? ~0U : 0;
|
GLuint curVBO = GL_SUPPORT(ARB_VERTEX_BUFFER_OBJECT) ? ~0U : 0;
|
||||||
int i;
|
int i;
|
||||||
|
@ -4284,7 +4371,8 @@ static inline void drawPrimitiveTraceDataLocations(const struct wined3d_stream_i
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void streamsrc(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void streamsrc(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
|
IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
|
||||||
BOOL fixup = FALSE;
|
BOOL fixup = FALSE;
|
||||||
struct wined3d_stream_info *dataLocations = &device->strided_streams;
|
struct wined3d_stream_info *dataLocations = &device->strided_streams;
|
||||||
|
@ -4363,7 +4451,8 @@ static void streamsrc(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
BOOL updateFog = FALSE;
|
BOOL updateFog = FALSE;
|
||||||
BOOL useVertexShaderFunction = use_vs(stateblock);
|
BOOL useVertexShaderFunction = use_vs(stateblock);
|
||||||
BOOL usePixelShaderFunction = use_ps(stateblock);
|
BOOL usePixelShaderFunction = use_ps(stateblock);
|
||||||
|
@ -4518,7 +4607,8 @@ static void vertexdeclaration(DWORD state, IWineD3DStateBlockImpl *stateblock, W
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void viewport_miscpart(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void viewport_miscpart(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
UINT width, height;
|
UINT width, height;
|
||||||
IWineD3DSurfaceImpl *target;
|
IWineD3DSurfaceImpl *target;
|
||||||
|
|
||||||
|
@ -4542,7 +4632,8 @@ static void viewport_miscpart(DWORD state, IWineD3DStateBlockImpl *stateblock, W
|
||||||
checkGLcall("glViewport");
|
checkGLcall("glViewport");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void viewport_vertexpart(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void viewport_vertexpart(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
stateblock->wineD3DDevice->posFixup[2] = 1.0f / stateblock->viewport.Width;
|
stateblock->wineD3DDevice->posFixup[2] = 1.0f / stateblock->viewport.Width;
|
||||||
stateblock->wineD3DDevice->posFixup[3] = -stateblock->wineD3DDevice->posFixup[1] / stateblock->viewport.Height;
|
stateblock->wineD3DDevice->posFixup[3] = -stateblock->wineD3DDevice->posFixup[1] / stateblock->viewport.Height;
|
||||||
if(!isStateDirty(context, STATE_TRANSFORM(WINED3DTS_PROJECTION))) {
|
if(!isStateDirty(context, STATE_TRANSFORM(WINED3DTS_PROJECTION))) {
|
||||||
|
@ -4553,7 +4644,8 @@ static void viewport_vertexpart(DWORD state, IWineD3DStateBlockImpl *stateblock,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void light(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void light(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
UINT Index = state - STATE_ACTIVELIGHT(0);
|
UINT Index = state - STATE_ACTIVELIGHT(0);
|
||||||
const PLIGHTINFOEL *lightInfo = stateblock->activeLights[Index];
|
const PLIGHTINFOEL *lightInfo = stateblock->activeLights[Index];
|
||||||
|
|
||||||
|
@ -4668,7 +4760,8 @@ static void light(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContex
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void scissorrect(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void scissorrect(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
RECT *pRect = &stateblock->scissorRect;
|
RECT *pRect = &stateblock->scissorRect;
|
||||||
UINT height;
|
UINT height;
|
||||||
UINT width;
|
UINT width;
|
||||||
|
@ -4689,7 +4782,8 @@ static void scissorrect(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
|
||||||
checkGLcall("glScissor");
|
checkGLcall("glScissor");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void indexbuffer(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void indexbuffer(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->streamIsUP || stateblock->pIndexData == NULL ) {
|
if(stateblock->streamIsUP || stateblock->pIndexData == NULL ) {
|
||||||
GL_EXTCALL(glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0));
|
GL_EXTCALL(glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0));
|
||||||
} else {
|
} else {
|
||||||
|
@ -4698,7 +4792,8 @@ static void indexbuffer(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void frontface(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void frontface(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->wineD3DDevice->render_offscreen) {
|
if(stateblock->wineD3DDevice->render_offscreen) {
|
||||||
glFrontFace(GL_CCW);
|
glFrontFace(GL_CCW);
|
||||||
checkGLcall("glFrontFace(GL_CCW)");
|
checkGLcall("glFrontFace(GL_CCW)");
|
||||||
|
@ -5468,12 +5563,14 @@ static unsigned int num_handlers(const APPLYSTATEFUNC *funcs)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void multistate_apply_2(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void multistate_apply_2(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
stateblock->wineD3DDevice->multistate_funcs[state][0](state, stateblock, context);
|
stateblock->wineD3DDevice->multistate_funcs[state][0](state, stateblock, context);
|
||||||
stateblock->wineD3DDevice->multistate_funcs[state][1](state, stateblock, context);
|
stateblock->wineD3DDevice->multistate_funcs[state][1](state, stateblock, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void multistate_apply_3(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
static void multistate_apply_3(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
stateblock->wineD3DDevice->multistate_funcs[state][0](state, stateblock, context);
|
stateblock->wineD3DDevice->multistate_funcs[state][0](state, stateblock, context);
|
||||||
stateblock->wineD3DDevice->multistate_funcs[state][1](state, stateblock, context);
|
stateblock->wineD3DDevice->multistate_funcs[state][1](state, stateblock, context);
|
||||||
stateblock->wineD3DDevice->multistate_funcs[state][2](state, stateblock, context);
|
stateblock->wineD3DDevice->multistate_funcs[state][2](state, stateblock, context);
|
||||||
|
|
|
@ -3140,7 +3140,7 @@ static inline void fb_copy_to_texture_hwstretch(IWineD3DSurfaceImpl *This, IWine
|
||||||
float left, right, top, bottom; /* Texture coordinates */
|
float left, right, top, bottom; /* Texture coordinates */
|
||||||
UINT fbwidth = Src->currentDesc.Width;
|
UINT fbwidth = Src->currentDesc.Width;
|
||||||
UINT fbheight = Src->currentDesc.Height;
|
UINT fbheight = Src->currentDesc.Height;
|
||||||
struct WineD3DContext *context;
|
struct wined3d_context *context;
|
||||||
GLenum drawBuffer = GL_BACK;
|
GLenum drawBuffer = GL_BACK;
|
||||||
GLenum texture_target;
|
GLenum texture_target;
|
||||||
BOOL noBackBufferBackup;
|
BOOL noBackBufferBackup;
|
||||||
|
@ -4374,7 +4374,7 @@ void surface_modify_ds_location(IWineD3DSurface *iface, DWORD location) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Context activation is done by the caller. */
|
/* Context activation is done by the caller. */
|
||||||
void surface_load_ds_location(IWineD3DSurface *iface, struct WineD3DContext *context, DWORD location)
|
void surface_load_ds_location(IWineD3DSurface *iface, struct wined3d_context *context, DWORD location)
|
||||||
{
|
{
|
||||||
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
|
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
|
||||||
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice;
|
IWineD3DDeviceImpl *device = This->resource.wineD3DDevice;
|
||||||
|
|
|
@ -372,10 +372,11 @@ const IWineD3DSwapChainVtbl IWineD3DSwapChain_Vtbl =
|
||||||
IWineD3DBaseSwapChainImpl_GetGammaRamp
|
IWineD3DBaseSwapChainImpl_GetGammaRamp
|
||||||
};
|
};
|
||||||
|
|
||||||
WineD3DContext *IWineD3DSwapChainImpl_CreateContextForThread(IWineD3DSwapChain *iface) {
|
struct wined3d_context *IWineD3DSwapChainImpl_CreateContextForThread(IWineD3DSwapChain *iface)
|
||||||
WineD3DContext *ctx;
|
{
|
||||||
IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *) iface;
|
IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *) iface;
|
||||||
WineD3DContext **newArray;
|
struct wined3d_context **newArray;
|
||||||
|
struct wined3d_context *ctx;
|
||||||
|
|
||||||
TRACE("Creating a new context for swapchain %p, thread %d\n", This, GetCurrentThreadId());
|
TRACE("Creating a new context for swapchain %p, thread %d\n", This, GetCurrentThreadId());
|
||||||
|
|
||||||
|
@ -402,7 +403,7 @@ WineD3DContext *IWineD3DSwapChainImpl_CreateContextForThread(IWineD3DSwapChain *
|
||||||
return ctx;
|
return ctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
void get_drawable_size_swapchain(struct WineD3DContext *context, UINT *width, UINT *height)
|
void get_drawable_size_swapchain(struct wined3d_context *context, UINT *width, UINT *height)
|
||||||
{
|
{
|
||||||
IWineD3DSurfaceImpl *surface = (IWineD3DSurfaceImpl *)context->current_rt;
|
IWineD3DSurfaceImpl *surface = (IWineD3DSurfaceImpl *)context->current_rt;
|
||||||
/* The drawable size of an onscreen drawable is the surface size.
|
/* The drawable size of an onscreen drawable is the surface size.
|
||||||
|
|
|
@ -2394,7 +2394,8 @@ void add_ffp_frag_shader(struct wine_rb_tree *shaders, struct ffp_frag_desc *des
|
||||||
*/
|
*/
|
||||||
#define GLINFO_LOCATION stateblock->wineD3DDevice->adapter->gl_info
|
#define GLINFO_LOCATION stateblock->wineD3DDevice->adapter->gl_info
|
||||||
/* GL locking is done by the caller (state handler) */
|
/* GL locking is done by the caller (state handler) */
|
||||||
void texture_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
void texture_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
if(stateblock->textures[stage]) {
|
if(stateblock->textures[stage]) {
|
||||||
switch (IWineD3DBaseTexture_GetTextureDimensions(stateblock->textures[stage])) {
|
switch (IWineD3DBaseTexture_GetTextureDimensions(stateblock->textures[stage])) {
|
||||||
case GL_TEXTURE_2D:
|
case GL_TEXTURE_2D:
|
||||||
|
@ -2468,7 +2469,8 @@ void texture_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateblock
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GL locking is done by the caller (state handler) */
|
/* GL locking is done by the caller (state handler) */
|
||||||
void sampler_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
void sampler_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
|
||||||
|
{
|
||||||
DWORD sampler = state - STATE_SAMPLER(0);
|
DWORD sampler = state - STATE_SAMPLER(0);
|
||||||
DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[sampler];
|
DWORD mapped_stage = stateblock->wineD3DDevice->texUnitMap[sampler];
|
||||||
|
|
||||||
|
|
|
@ -1070,8 +1070,6 @@ extern glMultiTexCoordFunc multi_texcoord_funcs[WINED3D_FFP_EMIT_COUNT];
|
||||||
(((((d3dvtVertexType) >> (16 + (2 * (tex_num)))) + 1) & 0x03) + 1)
|
(((((d3dvtVertexType) >> (16 + (2 * (tex_num)))) + 1) & 0x03) + 1)
|
||||||
|
|
||||||
/* Routines and structures related to state management */
|
/* Routines and structures related to state management */
|
||||||
typedef struct WineD3DContext WineD3DContext;
|
|
||||||
typedef void (*APPLYSTATEFUNC)(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *ctx);
|
|
||||||
|
|
||||||
#define STATE_RENDER(a) (a)
|
#define STATE_RENDER(a) (a)
|
||||||
#define STATE_IS_RENDER(a) ((a) >= STATE_RENDER(1) && (a) <= STATE_RENDER(WINEHIGHEST_RENDER_STATE))
|
#define STATE_IS_RENDER(a) ((a) >= STATE_RENDER(1) && (a) <= STATE_RENDER(WINEHIGHEST_RENDER_STATE))
|
||||||
|
@ -1123,63 +1121,6 @@ typedef void (*APPLYSTATEFUNC)(DWORD state, IWineD3DStateBlockImpl *stateblock,
|
||||||
|
|
||||||
#define STATE_HIGHEST (STATE_FRONTFACE)
|
#define STATE_HIGHEST (STATE_FRONTFACE)
|
||||||
|
|
||||||
struct StateEntry
|
|
||||||
{
|
|
||||||
DWORD representative;
|
|
||||||
APPLYSTATEFUNC apply;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct StateEntryTemplate
|
|
||||||
{
|
|
||||||
DWORD state;
|
|
||||||
struct StateEntry content;
|
|
||||||
GL_SupportedExt extension;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct fragment_caps {
|
|
||||||
DWORD PrimitiveMiscCaps;
|
|
||||||
|
|
||||||
DWORD TextureOpCaps;
|
|
||||||
DWORD MaxTextureBlendStages;
|
|
||||||
DWORD MaxSimultaneousTextures;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct fragment_pipeline {
|
|
||||||
void (*enable_extension)(IWineD3DDevice *iface, BOOL enable);
|
|
||||||
void (*get_caps)(WINED3DDEVTYPE devtype, const struct wined3d_gl_info *gl_info, struct fragment_caps *caps);
|
|
||||||
HRESULT (*alloc_private)(IWineD3DDevice *iface);
|
|
||||||
void (*free_private)(IWineD3DDevice *iface);
|
|
||||||
BOOL (*color_fixup_supported)(struct color_fixup_desc fixup);
|
|
||||||
const struct StateEntryTemplate *states;
|
|
||||||
BOOL ffp_proj_control;
|
|
||||||
};
|
|
||||||
|
|
||||||
extern const struct StateEntryTemplate misc_state_template[];
|
|
||||||
extern const struct StateEntryTemplate ffp_vertexstate_template[];
|
|
||||||
extern const struct fragment_pipeline ffp_fragment_pipeline;
|
|
||||||
extern const struct fragment_pipeline atifs_fragment_pipeline;
|
|
||||||
extern const struct fragment_pipeline arbfp_fragment_pipeline;
|
|
||||||
extern const struct fragment_pipeline nvts_fragment_pipeline;
|
|
||||||
extern const struct fragment_pipeline nvrc_fragment_pipeline;
|
|
||||||
|
|
||||||
/* "Base" state table */
|
|
||||||
HRESULT compile_state_table(struct StateEntry *StateTable, APPLYSTATEFUNC **dev_multistate_funcs,
|
|
||||||
const struct wined3d_gl_info *gl_info, const struct StateEntryTemplate *vertex,
|
|
||||||
const struct fragment_pipeline *fragment, const struct StateEntryTemplate *misc);
|
|
||||||
|
|
||||||
/* Shaders for color conversions in blits */
|
|
||||||
struct blit_shader {
|
|
||||||
HRESULT (*alloc_private)(IWineD3DDevice *iface);
|
|
||||||
void (*free_private)(IWineD3DDevice *iface);
|
|
||||||
HRESULT (*set_shader)(IWineD3DDevice *iface, const struct GlPixelFormatDesc *format_desc,
|
|
||||||
GLenum textype, UINT width, UINT height);
|
|
||||||
void (*unset_shader)(IWineD3DDevice *iface);
|
|
||||||
BOOL (*color_fixup_supported)(struct color_fixup_desc fixup);
|
|
||||||
};
|
|
||||||
|
|
||||||
extern const struct blit_shader ffp_blit;
|
|
||||||
extern const struct blit_shader arbfp_blit;
|
|
||||||
|
|
||||||
enum fogsource {
|
enum fogsource {
|
||||||
FOGSOURCE_FFP,
|
FOGSOURCE_FFP,
|
||||||
FOGSOURCE_VS,
|
FOGSOURCE_VS,
|
||||||
|
@ -1192,18 +1133,17 @@ struct wined3d_occlusion_query
|
||||||
{
|
{
|
||||||
struct list entry;
|
struct list entry;
|
||||||
GLuint id;
|
GLuint id;
|
||||||
struct WineD3DContext *context;
|
struct wined3d_context *context;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct wined3d_event_query
|
struct wined3d_event_query
|
||||||
{
|
{
|
||||||
struct list entry;
|
struct list entry;
|
||||||
GLuint id;
|
GLuint id;
|
||||||
struct WineD3DContext *context;
|
struct wined3d_context *context;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* The new context manager that should deal with onscreen and offscreen rendering */
|
struct wined3d_context
|
||||||
struct WineD3DContext
|
|
||||||
{
|
{
|
||||||
const struct wined3d_gl_info *gl_info;
|
const struct wined3d_gl_info *gl_info;
|
||||||
/* State dirtification
|
/* State dirtification
|
||||||
|
@ -1280,6 +1220,67 @@ struct WineD3DContext
|
||||||
GLuint dummy_arbfp_prog;
|
GLuint dummy_arbfp_prog;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef void (*APPLYSTATEFUNC)(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *ctx);
|
||||||
|
|
||||||
|
struct StateEntry
|
||||||
|
{
|
||||||
|
DWORD representative;
|
||||||
|
APPLYSTATEFUNC apply;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct StateEntryTemplate
|
||||||
|
{
|
||||||
|
DWORD state;
|
||||||
|
struct StateEntry content;
|
||||||
|
GL_SupportedExt extension;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct fragment_caps
|
||||||
|
{
|
||||||
|
DWORD PrimitiveMiscCaps;
|
||||||
|
DWORD TextureOpCaps;
|
||||||
|
DWORD MaxTextureBlendStages;
|
||||||
|
DWORD MaxSimultaneousTextures;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct fragment_pipeline
|
||||||
|
{
|
||||||
|
void (*enable_extension)(IWineD3DDevice *iface, BOOL enable);
|
||||||
|
void (*get_caps)(WINED3DDEVTYPE devtype, const struct wined3d_gl_info *gl_info, struct fragment_caps *caps);
|
||||||
|
HRESULT (*alloc_private)(IWineD3DDevice *iface);
|
||||||
|
void (*free_private)(IWineD3DDevice *iface);
|
||||||
|
BOOL (*color_fixup_supported)(struct color_fixup_desc fixup);
|
||||||
|
const struct StateEntryTemplate *states;
|
||||||
|
BOOL ffp_proj_control;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern const struct StateEntryTemplate misc_state_template[];
|
||||||
|
extern const struct StateEntryTemplate ffp_vertexstate_template[];
|
||||||
|
extern const struct fragment_pipeline ffp_fragment_pipeline;
|
||||||
|
extern const struct fragment_pipeline atifs_fragment_pipeline;
|
||||||
|
extern const struct fragment_pipeline arbfp_fragment_pipeline;
|
||||||
|
extern const struct fragment_pipeline nvts_fragment_pipeline;
|
||||||
|
extern const struct fragment_pipeline nvrc_fragment_pipeline;
|
||||||
|
|
||||||
|
/* "Base" state table */
|
||||||
|
HRESULT compile_state_table(struct StateEntry *StateTable, APPLYSTATEFUNC **dev_multistate_funcs,
|
||||||
|
const struct wined3d_gl_info *gl_info, const struct StateEntryTemplate *vertex,
|
||||||
|
const struct fragment_pipeline *fragment, const struct StateEntryTemplate *misc);
|
||||||
|
|
||||||
|
/* Shaders for color conversions in blits */
|
||||||
|
struct blit_shader
|
||||||
|
{
|
||||||
|
HRESULT (*alloc_private)(IWineD3DDevice *iface);
|
||||||
|
void (*free_private)(IWineD3DDevice *iface);
|
||||||
|
HRESULT (*set_shader)(IWineD3DDevice *iface, const struct GlPixelFormatDesc *format_desc,
|
||||||
|
GLenum textype, UINT width, UINT height);
|
||||||
|
void (*unset_shader)(IWineD3DDevice *iface);
|
||||||
|
BOOL (*color_fixup_supported)(struct color_fixup_desc fixup);
|
||||||
|
};
|
||||||
|
|
||||||
|
extern const struct blit_shader ffp_blit;
|
||||||
|
extern const struct blit_shader arbfp_blit;
|
||||||
|
|
||||||
typedef enum ContextUsage {
|
typedef enum ContextUsage {
|
||||||
CTXUSAGE_RESOURCELOAD = 1, /* Only loads textures: No State is applied */
|
CTXUSAGE_RESOURCELOAD = 1, /* Only loads textures: No State is applied */
|
||||||
CTXUSAGE_DRAWPRIM = 2, /* OpenGL states are set up for blitting DirectDraw surfaces */
|
CTXUSAGE_DRAWPRIM = 2, /* OpenGL states are set up for blitting DirectDraw surfaces */
|
||||||
|
@ -1287,22 +1288,23 @@ typedef enum ContextUsage {
|
||||||
CTXUSAGE_CLEAR = 4, /* Drawable and states are set up for clearing */
|
CTXUSAGE_CLEAR = 4, /* Drawable and states are set up for clearing */
|
||||||
} ContextUsage;
|
} ContextUsage;
|
||||||
|
|
||||||
struct WineD3DContext *ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, enum ContextUsage usage);
|
struct wined3d_context *ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, enum ContextUsage usage);
|
||||||
WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *target, HWND win, BOOL create_pbuffer, const WINED3DPRESENT_PARAMETERS *pPresentParms);
|
struct wined3d_context *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *target, HWND win,
|
||||||
void DestroyContext(IWineD3DDeviceImpl *This, WineD3DContext *context);
|
BOOL create_pbuffer, const WINED3DPRESENT_PARAMETERS *pPresentParms);
|
||||||
void context_alloc_event_query(struct WineD3DContext *context, struct wined3d_event_query *query);
|
void DestroyContext(IWineD3DDeviceImpl *This, struct wined3d_context *context);
|
||||||
void context_alloc_occlusion_query(struct WineD3DContext *context, struct wined3d_occlusion_query *query);
|
void context_alloc_event_query(struct wined3d_context *context, struct wined3d_event_query *query);
|
||||||
|
void context_alloc_occlusion_query(struct wined3d_context *context, struct wined3d_occlusion_query *query);
|
||||||
void context_resource_released(IWineD3DDevice *iface, IWineD3DResource *resource, WINED3DRESOURCETYPE type);
|
void context_resource_released(IWineD3DDevice *iface, IWineD3DResource *resource, WINED3DRESOURCETYPE type);
|
||||||
void context_bind_fbo(struct WineD3DContext *context, GLenum target, GLuint *fbo);
|
void context_bind_fbo(struct wined3d_context *context, GLenum target, GLuint *fbo);
|
||||||
void context_attach_depth_stencil_fbo(struct WineD3DContext *context,
|
void context_attach_depth_stencil_fbo(struct wined3d_context *context,
|
||||||
GLenum fbo_target, IWineD3DSurface *depth_stencil, BOOL use_render_buffer);
|
GLenum fbo_target, IWineD3DSurface *depth_stencil, BOOL use_render_buffer);
|
||||||
void context_attach_surface_fbo(const struct WineD3DContext *context,
|
void context_attach_surface_fbo(const struct wined3d_context *context,
|
||||||
GLenum fbo_target, DWORD idx, IWineD3DSurface *surface);
|
GLenum fbo_target, DWORD idx, IWineD3DSurface *surface);
|
||||||
void context_free_event_query(struct wined3d_event_query *query);
|
void context_free_event_query(struct wined3d_event_query *query);
|
||||||
void context_free_occlusion_query(struct wined3d_occlusion_query *query);
|
void context_free_occlusion_query(struct wined3d_occlusion_query *query);
|
||||||
struct WineD3DContext *context_get_current(void);
|
struct wined3d_context *context_get_current(void);
|
||||||
DWORD context_get_tls_idx(void);
|
DWORD context_get_tls_idx(void);
|
||||||
BOOL context_set_current(struct WineD3DContext *ctx);
|
BOOL context_set_current(struct wined3d_context *ctx);
|
||||||
void context_set_tls_idx(DWORD idx);
|
void context_set_tls_idx(DWORD idx);
|
||||||
|
|
||||||
void delete_opengl_contexts(IWineD3DDevice *iface, IWineD3DSwapChain *swapchain);
|
void delete_opengl_contexts(IWineD3DDevice *iface, IWineD3DSwapChain *swapchain);
|
||||||
|
@ -1615,9 +1617,9 @@ struct IWineD3DDeviceImpl
|
||||||
const WineDirect3DVertexStridedData *up_strided;
|
const WineDirect3DVertexStridedData *up_strided;
|
||||||
|
|
||||||
/* Context management */
|
/* Context management */
|
||||||
WineD3DContext **contexts; /* Dynamic array containing pointers to context structures */
|
struct wined3d_context **contexts;
|
||||||
UINT numContexts;
|
UINT numContexts;
|
||||||
WineD3DContext *pbufferContext; /* The context that has a pbuffer as drawable */
|
struct wined3d_context *pbufferContext; /* The context that has a pbuffer as drawable */
|
||||||
DWORD pbufferWidth, pbufferHeight; /* Size of the buffer drawable */
|
DWORD pbufferWidth, pbufferHeight; /* Size of the buffer drawable */
|
||||||
|
|
||||||
/* High level patch management */
|
/* High level patch management */
|
||||||
|
@ -1640,7 +1642,8 @@ HRESULT IWineD3DDeviceImpl_ClearSurface(IWineD3DDeviceImpl *This, IWineD3DSurfa
|
||||||
float Z, DWORD Stencil);
|
float Z, DWORD Stencil);
|
||||||
void IWineD3DDeviceImpl_FindTexUnitMap(IWineD3DDeviceImpl *This);
|
void IWineD3DDeviceImpl_FindTexUnitMap(IWineD3DDeviceImpl *This);
|
||||||
void IWineD3DDeviceImpl_MarkStateDirty(IWineD3DDeviceImpl *This, DWORD state);
|
void IWineD3DDeviceImpl_MarkStateDirty(IWineD3DDeviceImpl *This, DWORD state);
|
||||||
static inline BOOL isStateDirty(WineD3DContext *context, DWORD state) {
|
static inline BOOL isStateDirty(struct wined3d_context *context, DWORD state)
|
||||||
|
{
|
||||||
DWORD idx = state >> 5;
|
DWORD idx = state >> 5;
|
||||||
BYTE shift = state & 0x1f;
|
BYTE shift = state & 0x1f;
|
||||||
return context->isStateDirty[idx] & (1 << shift);
|
return context->isStateDirty[idx] & (1 << shift);
|
||||||
|
@ -1956,7 +1959,7 @@ struct IWineD3DSurfaceImpl
|
||||||
UINT pow2Height;
|
UINT pow2Height;
|
||||||
|
|
||||||
/* A method to retrieve the drawable size. Not in the Vtable to make it changeable */
|
/* A method to retrieve the drawable size. Not in the Vtable to make it changeable */
|
||||||
void (*get_drawable_size)(struct WineD3DContext *context, UINT *width, UINT *height);
|
void (*get_drawable_size)(struct wined3d_context *context, UINT *width, UINT *height);
|
||||||
|
|
||||||
/* Oversized texture */
|
/* Oversized texture */
|
||||||
RECT glRect;
|
RECT glRect;
|
||||||
|
@ -2050,10 +2053,10 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED3DL
|
||||||
void WINAPI IWineD3DBaseSurfaceImpl_BindTexture(IWineD3DSurface *iface, BOOL srgb);
|
void WINAPI IWineD3DBaseSurfaceImpl_BindTexture(IWineD3DSurface *iface, BOOL srgb);
|
||||||
const void *WINAPI IWineD3DBaseSurfaceImpl_GetData(IWineD3DSurface *iface);
|
const void *WINAPI IWineD3DBaseSurfaceImpl_GetData(IWineD3DSurface *iface);
|
||||||
|
|
||||||
void get_drawable_size_swapchain(struct WineD3DContext *context, UINT *width, UINT *height);
|
void get_drawable_size_swapchain(struct wined3d_context *context, UINT *width, UINT *height);
|
||||||
void get_drawable_size_backbuffer(struct WineD3DContext *context, UINT *width, UINT *height);
|
void get_drawable_size_backbuffer(struct wined3d_context *context, UINT *width, UINT *height);
|
||||||
void get_drawable_size_pbuffer(struct WineD3DContext *context, UINT *width, UINT *height);
|
void get_drawable_size_pbuffer(struct wined3d_context *context, UINT *width, UINT *height);
|
||||||
void get_drawable_size_fbo(struct WineD3DContext *context, UINT *width, UINT *height);
|
void get_drawable_size_fbo(struct wined3d_context *context, UINT *width, UINT *height);
|
||||||
|
|
||||||
void flip_surface(IWineD3DSurfaceImpl *front, IWineD3DSurfaceImpl *back);
|
void flip_surface(IWineD3DSurfaceImpl *front, IWineD3DSurfaceImpl *back);
|
||||||
|
|
||||||
|
@ -2463,7 +2466,7 @@ typedef struct IWineD3DSwapChainImpl
|
||||||
long prev_time, frames; /* Performance tracking */
|
long prev_time, frames; /* Performance tracking */
|
||||||
unsigned int vSyncCounter;
|
unsigned int vSyncCounter;
|
||||||
|
|
||||||
WineD3DContext **context; /* Later a array for multithreading */
|
struct wined3d_context **context;
|
||||||
unsigned int num_contexts;
|
unsigned int num_contexts;
|
||||||
|
|
||||||
HWND win_handle;
|
HWND win_handle;
|
||||||
|
@ -2486,7 +2489,7 @@ HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetPresentParameters(IWineD3DSwapChain
|
||||||
HRESULT WINAPI IWineD3DBaseSwapChainImpl_SetGammaRamp(IWineD3DSwapChain *iface, DWORD Flags, CONST WINED3DGAMMARAMP *pRamp);
|
HRESULT WINAPI IWineD3DBaseSwapChainImpl_SetGammaRamp(IWineD3DSwapChain *iface, DWORD Flags, CONST WINED3DGAMMARAMP *pRamp);
|
||||||
HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetGammaRamp(IWineD3DSwapChain *iface, WINED3DGAMMARAMP *pRamp);
|
HRESULT WINAPI IWineD3DBaseSwapChainImpl_GetGammaRamp(IWineD3DSwapChain *iface, WINED3DGAMMARAMP *pRamp);
|
||||||
|
|
||||||
WineD3DContext *IWineD3DSwapChainImpl_CreateContextForThread(IWineD3DSwapChain *iface);
|
struct wined3d_context *IWineD3DSwapChainImpl_CreateContextForThread(IWineD3DSwapChain *iface);
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Utility function prototypes
|
* Utility function prototypes
|
||||||
|
@ -2521,18 +2524,18 @@ GLenum CompareFunc(DWORD func);
|
||||||
BOOL is_invalid_op(IWineD3DDeviceImpl *This, int stage, WINED3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3);
|
BOOL is_invalid_op(IWineD3DDeviceImpl *This, int stage, WINED3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3);
|
||||||
void set_tex_op_nvrc(IWineD3DDevice *iface, BOOL is_alpha, int stage, WINED3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3, INT texture_idx, DWORD dst);
|
void set_tex_op_nvrc(IWineD3DDevice *iface, BOOL is_alpha, int stage, WINED3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3, INT texture_idx, DWORD dst);
|
||||||
void set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords, BOOL transformed, DWORD coordtype, BOOL ffp_can_disable_proj);
|
void set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords, BOOL transformed, DWORD coordtype, BOOL ffp_can_disable_proj);
|
||||||
void texture_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context);
|
void texture_activate_dimensions(DWORD stage, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context);
|
||||||
void sampler_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context);
|
void sampler_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context);
|
||||||
void tex_alphaop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context);
|
void tex_alphaop(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context);
|
||||||
void apply_pixelshader(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context);
|
void apply_pixelshader(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context);
|
||||||
void state_fogcolor(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context);
|
void state_fogcolor(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context);
|
||||||
void state_fogdensity(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context);
|
void state_fogdensity(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context);
|
||||||
void state_fogstartend(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context);
|
void state_fogstartend(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context);
|
||||||
void state_fog_fragpart(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context);
|
void state_fog_fragpart(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context);
|
||||||
|
|
||||||
void surface_add_dirty_rect(IWineD3DSurface *iface, const RECT *dirty_rect);
|
void surface_add_dirty_rect(IWineD3DSurface *iface, const RECT *dirty_rect);
|
||||||
GLenum surface_get_gl_buffer(IWineD3DSurface *iface, IWineD3DSwapChain *swapchain);
|
GLenum surface_get_gl_buffer(IWineD3DSurface *iface, IWineD3DSwapChain *swapchain);
|
||||||
void surface_load_ds_location(IWineD3DSurface *iface, struct WineD3DContext *context, DWORD location);
|
void surface_load_ds_location(IWineD3DSurface *iface, struct wined3d_context *context, DWORD location);
|
||||||
void surface_modify_ds_location(IWineD3DSurface *iface, DWORD location);
|
void surface_modify_ds_location(IWineD3DSurface *iface, DWORD location);
|
||||||
void surface_set_compatible_renderbuffer(IWineD3DSurface *iface, unsigned int width, unsigned int height);
|
void surface_set_compatible_renderbuffer(IWineD3DSurface *iface, unsigned int width, unsigned int height);
|
||||||
void surface_set_texture_name(IWineD3DSurface *iface, GLuint name, BOOL srgb_name);
|
void surface_set_texture_name(IWineD3DSurface *iface, GLuint name, BOOL srgb_name);
|
||||||
|
|
Loading…
Reference in New Issue