wined3d: Rename the fragment ffp desc structures.
This reflects the fact that they describe the fragment pipeline. The vertex pipeline will use its own structures.
This commit is contained in:
parent
cd011661e6
commit
5c79a9f437
|
@ -2372,7 +2372,7 @@ const shader_backend_t arb_program_shader_backend = {
|
|||
|
||||
struct arbfp_ffp_desc
|
||||
{
|
||||
struct ffp_desc parent;
|
||||
struct ffp_frag_desc parent;
|
||||
GLuint shader;
|
||||
unsigned int num_textures_used;
|
||||
};
|
||||
|
@ -2401,7 +2401,7 @@ static HRESULT arbfp_alloc(IWineD3DDevice *iface) {
|
|||
if(!This->fragment_priv) return E_OUTOFMEMORY;
|
||||
}
|
||||
priv = (struct shader_arb_priv *) This->fragment_priv;
|
||||
priv->fragment_shaders = hash_table_create(ffp_program_key_hash, ffp_program_key_compare);
|
||||
priv->fragment_shaders = hash_table_create(ffp_frag_program_key_hash, ffp_frag_program_key_compare);
|
||||
priv->use_arbfp_fixed_func = TRUE;
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
@ -2792,7 +2792,7 @@ static void gen_ffp_instr(SHADER_BUFFER *buffer, unsigned int stage, BOOL color,
|
|||
}
|
||||
|
||||
/* The stateblock is passed for GLINFO_LOCATION */
|
||||
static GLuint gen_arbfp_ffp_shader(struct ffp_settings *settings, IWineD3DStateBlockImpl *stateblock) {
|
||||
static GLuint gen_arbfp_ffp_shader(struct ffp_frag_settings *settings, IWineD3DStateBlockImpl *stateblock) {
|
||||
unsigned int stage;
|
||||
SHADER_BUFFER buffer;
|
||||
BOOL tex_read[MAX_TEXTURES] = {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE};
|
||||
|
@ -3060,7 +3060,7 @@ static void fragment_prog_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock,
|
|||
struct shader_arb_priv *priv = (struct shader_arb_priv *) device->fragment_priv;
|
||||
BOOL use_pshader = use_ps(device);
|
||||
BOOL use_vshader = use_vs(device);
|
||||
struct ffp_settings settings;
|
||||
struct ffp_frag_settings settings;
|
||||
struct arbfp_ffp_desc *desc;
|
||||
unsigned int i;
|
||||
|
||||
|
@ -3082,8 +3082,8 @@ static void fragment_prog_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock,
|
|||
IWineD3DPixelShader_CompileShader(stateblock->pixelShader);
|
||||
} else {
|
||||
/* Find or create a shader implementing the fixed function pipeline settings, then activate it */
|
||||
gen_ffp_op(stateblock, &settings, FALSE);
|
||||
desc = (struct arbfp_ffp_desc *) find_ffp_shader(priv->fragment_shaders, &settings);
|
||||
gen_ffp_frag_op(stateblock, &settings, FALSE);
|
||||
desc = (struct arbfp_ffp_desc *) find_ffp_frag_shader(priv->fragment_shaders, &settings);
|
||||
if(!desc) {
|
||||
desc = HeapAlloc(GetProcessHeap(), 0, sizeof(*desc));
|
||||
if(!desc) {
|
||||
|
@ -3098,7 +3098,7 @@ static void fragment_prog_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock,
|
|||
|
||||
memcpy(&desc->parent.settings, &settings, sizeof(settings));
|
||||
desc->shader = gen_arbfp_ffp_shader(&settings, stateblock);
|
||||
add_ffp_shader(priv->fragment_shaders, &desc->parent);
|
||||
add_ffp_frag_shader(priv->fragment_shaders, &desc->parent);
|
||||
TRACE("Allocated fixed function replacement shader descriptor %p\n", desc);
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader);
|
|||
/* GL_ATI_fragment_shader specific fixed function pipeline description. "Inherits" from the common one */
|
||||
struct atifs_ffp_desc
|
||||
{
|
||||
struct ffp_desc parent;
|
||||
struct ffp_frag_desc parent;
|
||||
GLuint shader;
|
||||
unsigned int num_textures_used;
|
||||
};
|
||||
|
@ -803,13 +803,13 @@ static GLuint gen_ati_shader(struct texture_stage_op op[MAX_TEXTURES], WineD3D_G
|
|||
static void set_tex_op_atifs(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
|
||||
IWineD3DDeviceImpl *This = stateblock->wineD3DDevice;
|
||||
struct atifs_ffp_desc *desc;
|
||||
struct ffp_settings settings;
|
||||
struct ffp_frag_settings settings;
|
||||
struct atifs_private_data *priv = (struct atifs_private_data *) This->fragment_priv;
|
||||
DWORD mapped_stage;
|
||||
unsigned int i;
|
||||
|
||||
gen_ffp_op(stateblock, &settings, TRUE);
|
||||
desc = (struct atifs_ffp_desc *) find_ffp_shader(priv->fragment_shaders, &settings);
|
||||
gen_ffp_frag_op(stateblock, &settings, TRUE);
|
||||
desc = (struct atifs_ffp_desc *) find_ffp_frag_shader(priv->fragment_shaders, &settings);
|
||||
if(!desc) {
|
||||
desc = HeapAlloc(GetProcessHeap(), 0, sizeof(*desc));
|
||||
if(!desc) {
|
||||
|
@ -824,7 +824,7 @@ static void set_tex_op_atifs(DWORD state, IWineD3DStateBlockImpl *stateblock, Wi
|
|||
|
||||
memcpy(&desc->parent.settings, &settings, sizeof(settings));
|
||||
desc->shader = gen_ati_shader(settings.op, &GLINFO_LOCATION);
|
||||
add_ffp_shader(priv->fragment_shaders, &desc->parent);
|
||||
add_ffp_frag_shader(priv->fragment_shaders, &desc->parent);
|
||||
TRACE("Allocated fixed function replacement shader descriptor %p\n", desc);
|
||||
}
|
||||
|
||||
|
@ -1074,7 +1074,7 @@ static HRESULT atifs_alloc(IWineD3DDevice *iface) {
|
|||
return E_OUTOFMEMORY;
|
||||
}
|
||||
priv = (struct atifs_private_data *) This->fragment_priv;
|
||||
priv->fragment_shaders = hash_table_create(ffp_program_key_hash, ffp_program_key_compare);
|
||||
priv->fragment_shaders = hash_table_create(ffp_frag_program_key_hash, ffp_frag_program_key_compare);
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -1793,7 +1793,7 @@ void *hash_table_get(struct hash_table_t *table, void *key)
|
|||
}
|
||||
|
||||
#define GLINFO_LOCATION stateblock->wineD3DDevice->adapter->gl_info
|
||||
void gen_ffp_op(IWineD3DStateBlockImpl *stateblock, struct ffp_settings *settings, BOOL ignore_textype) {
|
||||
void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_settings *settings, BOOL ignore_textype) {
|
||||
#define ARG1 0x01
|
||||
#define ARG2 0x02
|
||||
#define ARG0 0x04
|
||||
|
@ -2013,13 +2013,13 @@ void gen_ffp_op(IWineD3DStateBlockImpl *stateblock, struct ffp_settings *setting
|
|||
}
|
||||
#undef GLINFO_LOCATION
|
||||
|
||||
struct ffp_desc *find_ffp_shader(struct hash_table_t *fragment_shaders, struct ffp_settings *settings)
|
||||
struct ffp_frag_desc *find_ffp_frag_shader(struct hash_table_t *fragment_shaders, struct ffp_frag_settings *settings)
|
||||
{
|
||||
return (struct ffp_desc *)hash_table_get(fragment_shaders, settings);}
|
||||
return (struct ffp_frag_desc *)hash_table_get(fragment_shaders, settings);}
|
||||
|
||||
void add_ffp_shader(struct hash_table_t *shaders, struct ffp_desc *desc) {
|
||||
struct ffp_settings *key = HeapAlloc(GetProcessHeap(), 0, sizeof(*key));
|
||||
/* Note that the key is the implementation independent part of the ffp_desc structure,
|
||||
void add_ffp_frag_shader(struct hash_table_t *shaders, struct ffp_frag_desc *desc) {
|
||||
struct ffp_frag_settings *key = HeapAlloc(GetProcessHeap(), 0, sizeof(*key));
|
||||
/* Note that the key is the implementation independent part of the ffp_frag_desc structure,
|
||||
* whereas desc points to an extended structure with implementation specific parts.
|
||||
* Make a copy of the key because hash_table_put takes ownership of it
|
||||
*/
|
||||
|
@ -2121,8 +2121,8 @@ void sampler_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCont
|
|||
}
|
||||
#undef GLINFO_LOCATION
|
||||
|
||||
unsigned int ffp_program_key_hash(void *key) {
|
||||
struct ffp_settings *k = (struct ffp_settings *)key;
|
||||
unsigned int ffp_frag_program_key_hash(void *key) {
|
||||
struct ffp_frag_settings *k = (struct ffp_frag_settings *)key;
|
||||
unsigned int hash = 0, i;
|
||||
DWORD *blob;
|
||||
|
||||
|
@ -2147,9 +2147,9 @@ unsigned int ffp_program_key_hash(void *key) {
|
|||
return hash;
|
||||
}
|
||||
|
||||
BOOL ffp_program_key_compare(void *keya, void *keyb) {
|
||||
struct ffp_settings *ka = (struct ffp_settings *)keya;
|
||||
struct ffp_settings *kb = (struct ffp_settings *)keyb;
|
||||
BOOL ffp_frag_program_key_compare(void *keya, void *keyb) {
|
||||
struct ffp_frag_settings *ka = (struct ffp_frag_settings *)keya;
|
||||
struct ffp_frag_settings *kb = (struct ffp_frag_settings *)keyb;
|
||||
|
||||
return memcmp(ka, kb, sizeof(*ka)) == 0;
|
||||
}
|
||||
|
|
|
@ -853,7 +853,7 @@ struct texture_stage_op
|
|||
WINED3DFORMAT color_correction;
|
||||
};
|
||||
|
||||
struct ffp_settings {
|
||||
struct ffp_frag_settings {
|
||||
struct texture_stage_op op[MAX_TEXTURES];
|
||||
enum {
|
||||
FOG_OFF,
|
||||
|
@ -865,16 +865,16 @@ struct ffp_settings {
|
|||
unsigned int sRGB_write;
|
||||
};
|
||||
|
||||
struct ffp_desc
|
||||
struct ffp_frag_desc
|
||||
{
|
||||
struct ffp_settings settings;
|
||||
struct ffp_frag_settings settings;
|
||||
};
|
||||
|
||||
void gen_ffp_op(IWineD3DStateBlockImpl *stateblock, struct ffp_settings *settings, BOOL ignore_textype);
|
||||
struct ffp_desc *find_ffp_shader(struct hash_table_t *fragment_shaders, struct ffp_settings *settings);
|
||||
void add_ffp_shader(struct hash_table_t *shaders, struct ffp_desc *desc);
|
||||
BOOL ffp_program_key_compare(void *keya, void *keyb);
|
||||
unsigned int ffp_program_key_hash(void *key);
|
||||
void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_settings *settings, BOOL ignore_textype);
|
||||
struct ffp_frag_desc *find_ffp_frag_shader(struct hash_table_t *fragment_shaders, struct ffp_frag_settings *settings);
|
||||
void add_ffp_frag_shader(struct hash_table_t *shaders, struct ffp_frag_desc *desc);
|
||||
BOOL ffp_frag_program_key_compare(void *keya, void *keyb);
|
||||
unsigned int ffp_frag_program_key_hash(void *key);
|
||||
|
||||
/*****************************************************************************
|
||||
* IWineD3D implementation structure
|
||||
|
|
Loading…
Reference in New Issue