Commit 40b41195 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Rename "SHADER_BUFFER" to something sane.

parent bddc4d3f
...@@ -603,8 +603,8 @@ static DWORD *local_const_mapping(IWineD3DBaseShaderImpl *This) ...@@ -603,8 +603,8 @@ static DWORD *local_const_mapping(IWineD3DBaseShaderImpl *This)
/* Generate the variable & register declarations for the ARB_vertex_program output target */ /* Generate the variable & register declarations for the ARB_vertex_program output target */
static DWORD shader_generate_arb_declarations(IWineD3DBaseShader *iface, const shader_reg_maps *reg_maps, static DWORD shader_generate_arb_declarations(IWineD3DBaseShader *iface, const shader_reg_maps *reg_maps,
SHADER_BUFFER *buffer, const WineD3D_GL_Info *gl_info, DWORD *lconst_map, DWORD *num_clipplanes, struct wined3d_shader_buffer *buffer, const WineD3D_GL_Info *gl_info, DWORD *lconst_map,
struct shader_arb_ctx_priv *ctx) DWORD *num_clipplanes, struct shader_arb_ctx_priv *ctx)
{ {
IWineD3DBaseShaderImpl* This = (IWineD3DBaseShaderImpl*) iface; IWineD3DBaseShaderImpl* This = (IWineD3DBaseShaderImpl*) iface;
DWORD i, next_local = 0; DWORD i, next_local = 0;
...@@ -778,7 +778,7 @@ static void shader_arb_get_swizzle(const struct wined3d_shader_src_param *param, ...@@ -778,7 +778,7 @@ static void shader_arb_get_swizzle(const struct wined3d_shader_src_param *param,
static void shader_arb_request_a0(const struct wined3d_shader_instruction *ins, const char *src) static void shader_arb_request_a0(const struct wined3d_shader_instruction *ins, const char *src)
{ {
struct shader_arb_ctx_priv *priv = ins->ctx->backend_data; struct shader_arb_ctx_priv *priv = ins->ctx->backend_data;
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
if(strcmp(priv->addr_reg, src) == 0) return; if(strcmp(priv->addr_reg, src) == 0) return;
...@@ -1082,8 +1082,8 @@ static const char *shader_arb_get_fixup_swizzle(enum fixup_channel_source channe ...@@ -1082,8 +1082,8 @@ static const char *shader_arb_get_fixup_swizzle(enum fixup_channel_source channe
} }
} }
static void gen_color_correction(SHADER_BUFFER *buffer, const char *reg, DWORD dst_mask, static void gen_color_correction(struct wined3d_shader_buffer *buffer, const char *reg,
const char *one, const char *two, struct color_fixup_desc fixup) DWORD dst_mask, const char *one, const char *two, struct color_fixup_desc fixup)
{ {
DWORD mask; DWORD mask;
...@@ -1179,7 +1179,7 @@ static const char *shader_arb_get_modifier(const struct wined3d_shader_instructi ...@@ -1179,7 +1179,7 @@ static const char *shader_arb_get_modifier(const struct wined3d_shader_instructi
static void shader_hw_sample(const struct wined3d_shader_instruction *ins, DWORD sampler_idx, static void shader_hw_sample(const struct wined3d_shader_instruction *ins, DWORD sampler_idx,
const char *dst_str, const char *coord_reg, WORD flags, const char *dsx, const char *dsy) const char *dst_str, const char *coord_reg, WORD flags, const char *dsx, const char *dsy)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
DWORD sampler_type = ins->ctx->reg_maps->sampler_type[sampler_idx]; DWORD sampler_type = ins->ctx->reg_maps->sampler_type[sampler_idx];
const char *tex_type; const char *tex_type;
BOOL np2_fixup = FALSE; BOOL np2_fixup = FALSE;
...@@ -1293,7 +1293,7 @@ static void shader_arb_get_src_param(const struct wined3d_shader_instruction *in ...@@ -1293,7 +1293,7 @@ static void shader_arb_get_src_param(const struct wined3d_shader_instruction *in
char regstr[256]; char regstr[256];
char swzstr[20]; char swzstr[20];
int insert_line; int insert_line;
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
struct shader_arb_ctx_priv *ctx = ins->ctx->backend_data; struct shader_arb_ctx_priv *ctx = ins->ctx->backend_data;
/* Assume a new line will be added */ /* Assume a new line will be added */
...@@ -1372,7 +1372,7 @@ static void shader_arb_get_src_param(const struct wined3d_shader_instruction *in ...@@ -1372,7 +1372,7 @@ static void shader_arb_get_src_param(const struct wined3d_shader_instruction *in
static void pshader_hw_bem(const struct wined3d_shader_instruction *ins) static void pshader_hw_bem(const struct wined3d_shader_instruction *ins)
{ {
const struct wined3d_shader_dst_param *dst = &ins->dst[0]; const struct wined3d_shader_dst_param *dst = &ins->dst[0];
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
char dst_name[50]; char dst_name[50];
char src_name[2][50]; char src_name[2][50];
DWORD sampler_code = dst->reg.idx; DWORD sampler_code = dst->reg.idx;
...@@ -1421,7 +1421,7 @@ static DWORD negate_modifiers(DWORD mod, char *extra_char) ...@@ -1421,7 +1421,7 @@ static DWORD negate_modifiers(DWORD mod, char *extra_char)
static void pshader_hw_cnd(const struct wined3d_shader_instruction *ins) static void pshader_hw_cnd(const struct wined3d_shader_instruction *ins)
{ {
const struct wined3d_shader_dst_param *dst = &ins->dst[0]; const struct wined3d_shader_dst_param *dst = &ins->dst[0];
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
char dst_name[50]; char dst_name[50];
char src_name[3][50]; char src_name[3][50];
DWORD shader_version = WINED3D_SHADER_VERSION(ins->ctx->reg_maps->shader_version.major, DWORD shader_version = WINED3D_SHADER_VERSION(ins->ctx->reg_maps->shader_version.major,
...@@ -1460,7 +1460,7 @@ static void pshader_hw_cnd(const struct wined3d_shader_instruction *ins) ...@@ -1460,7 +1460,7 @@ static void pshader_hw_cnd(const struct wined3d_shader_instruction *ins)
static void pshader_hw_cmp(const struct wined3d_shader_instruction *ins) static void pshader_hw_cmp(const struct wined3d_shader_instruction *ins)
{ {
const struct wined3d_shader_dst_param *dst = &ins->dst[0]; const struct wined3d_shader_dst_param *dst = &ins->dst[0];
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
char dst_name[50]; char dst_name[50];
char src_name[3][50]; char src_name[3][50];
BOOL is_color; BOOL is_color;
...@@ -1488,7 +1488,7 @@ static void pshader_hw_cmp(const struct wined3d_shader_instruction *ins) ...@@ -1488,7 +1488,7 @@ static void pshader_hw_cmp(const struct wined3d_shader_instruction *ins)
static void pshader_hw_dp2add(const struct wined3d_shader_instruction *ins) static void pshader_hw_dp2add(const struct wined3d_shader_instruction *ins)
{ {
const struct wined3d_shader_dst_param *dst = &ins->dst[0]; const struct wined3d_shader_dst_param *dst = &ins->dst[0];
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
char dst_name[50]; char dst_name[50];
char src_name[3][50]; char src_name[3][50];
struct shader_arb_ctx_priv *ctx = ins->ctx->backend_data; struct shader_arb_ctx_priv *ctx = ins->ctx->backend_data;
...@@ -1541,7 +1541,7 @@ static void pshader_hw_dp2add(const struct wined3d_shader_instruction *ins) ...@@ -1541,7 +1541,7 @@ static void pshader_hw_dp2add(const struct wined3d_shader_instruction *ins)
/* Map the opcode 1-to-1 to the GL code */ /* Map the opcode 1-to-1 to the GL code */
static void shader_hw_map2gl(const struct wined3d_shader_instruction *ins) static void shader_hw_map2gl(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
const char *instruction; const char *instruction;
char arguments[256], dst_str[50]; char arguments[256], dst_str[50];
unsigned int i; unsigned int i;
...@@ -1591,7 +1591,7 @@ static void shader_hw_map2gl(const struct wined3d_shader_instruction *ins) ...@@ -1591,7 +1591,7 @@ static void shader_hw_map2gl(const struct wined3d_shader_instruction *ins)
static void shader_hw_nop(const struct wined3d_shader_instruction *ins) static void shader_hw_nop(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
shader_addline(buffer, "NOP;\n"); shader_addline(buffer, "NOP;\n");
} }
...@@ -1601,7 +1601,7 @@ static void shader_hw_mov(const struct wined3d_shader_instruction *ins) ...@@ -1601,7 +1601,7 @@ static void shader_hw_mov(const struct wined3d_shader_instruction *ins)
BOOL pshader = shader_is_pshader_version(shader->baseShader.reg_maps.shader_version.type); BOOL pshader = shader_is_pshader_version(shader->baseShader.reg_maps.shader_version.type);
struct shader_arb_ctx_priv *ctx = ins->ctx->backend_data; struct shader_arb_ctx_priv *ctx = ins->ctx->backend_data;
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
char src0_param[256]; char src0_param[256];
if(ins->handler_idx == WINED3DSIH_MOVA) { if(ins->handler_idx == WINED3DSIH_MOVA) {
...@@ -1680,7 +1680,7 @@ static void shader_hw_mov(const struct wined3d_shader_instruction *ins) ...@@ -1680,7 +1680,7 @@ static void shader_hw_mov(const struct wined3d_shader_instruction *ins)
static void pshader_hw_texkill(const struct wined3d_shader_instruction *ins) static void pshader_hw_texkill(const struct wined3d_shader_instruction *ins)
{ {
const struct wined3d_shader_dst_param *dst = &ins->dst[0]; const struct wined3d_shader_dst_param *dst = &ins->dst[0];
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
char reg_dest[40]; char reg_dest[40];
/* No swizzles are allowed in d3d's texkill. PS 1.x ignores the 4th component as documented, /* No swizzles are allowed in d3d's texkill. PS 1.x ignores the 4th component as documented,
...@@ -1803,7 +1803,7 @@ static void pshader_hw_tex(const struct wined3d_shader_instruction *ins) ...@@ -1803,7 +1803,7 @@ static void pshader_hw_tex(const struct wined3d_shader_instruction *ins)
static void pshader_hw_texcoord(const struct wined3d_shader_instruction *ins) static void pshader_hw_texcoord(const struct wined3d_shader_instruction *ins)
{ {
const struct wined3d_shader_dst_param *dst = &ins->dst[0]; const struct wined3d_shader_dst_param *dst = &ins->dst[0];
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
DWORD shader_version = WINED3D_SHADER_VERSION(ins->ctx->reg_maps->shader_version.major, DWORD shader_version = WINED3D_SHADER_VERSION(ins->ctx->reg_maps->shader_version.major,
ins->ctx->reg_maps->shader_version.minor); ins->ctx->reg_maps->shader_version.minor);
char dst_str[50]; char dst_str[50];
...@@ -1825,7 +1825,7 @@ static void pshader_hw_texcoord(const struct wined3d_shader_instruction *ins) ...@@ -1825,7 +1825,7 @@ static void pshader_hw_texcoord(const struct wined3d_shader_instruction *ins)
static void pshader_hw_texreg2ar(const struct wined3d_shader_instruction *ins) static void pshader_hw_texreg2ar(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
IWineD3DPixelShaderImpl *This = (IWineD3DPixelShaderImpl *)ins->ctx->shader; IWineD3DPixelShaderImpl *This = (IWineD3DPixelShaderImpl *)ins->ctx->shader;
IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) This->baseShader.device; IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) This->baseShader.device;
DWORD flags; DWORD flags;
...@@ -1846,7 +1846,7 @@ static void pshader_hw_texreg2ar(const struct wined3d_shader_instruction *ins) ...@@ -1846,7 +1846,7 @@ static void pshader_hw_texreg2ar(const struct wined3d_shader_instruction *ins)
static void pshader_hw_texreg2gb(const struct wined3d_shader_instruction *ins) static void pshader_hw_texreg2gb(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
DWORD reg1 = ins->dst[0].reg.idx; DWORD reg1 = ins->dst[0].reg.idx;
char dst_str[50]; char dst_str[50];
...@@ -1876,7 +1876,7 @@ static void pshader_hw_texbem(const struct wined3d_shader_instruction *ins) ...@@ -1876,7 +1876,7 @@ static void pshader_hw_texbem(const struct wined3d_shader_instruction *ins)
{ {
IWineD3DPixelShaderImpl *This = (IWineD3DPixelShaderImpl *)ins->ctx->shader; IWineD3DPixelShaderImpl *This = (IWineD3DPixelShaderImpl *)ins->ctx->shader;
const struct wined3d_shader_dst_param *dst = &ins->dst[0]; const struct wined3d_shader_dst_param *dst = &ins->dst[0];
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
char reg_coord[40], dst_reg[50], src_reg[50]; char reg_coord[40], dst_reg[50], src_reg[50];
DWORD reg_dest_code; DWORD reg_dest_code;
...@@ -1929,7 +1929,7 @@ static void pshader_hw_texbem(const struct wined3d_shader_instruction *ins) ...@@ -1929,7 +1929,7 @@ static void pshader_hw_texbem(const struct wined3d_shader_instruction *ins)
static void pshader_hw_texm3x2pad(const struct wined3d_shader_instruction *ins) static void pshader_hw_texm3x2pad(const struct wined3d_shader_instruction *ins)
{ {
DWORD reg = ins->dst[0].reg.idx; DWORD reg = ins->dst[0].reg.idx;
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
char src0_name[50], dst_name[50]; char src0_name[50], dst_name[50];
BOOL is_color; BOOL is_color;
struct wined3d_shader_register tmp_reg = ins->dst[0].reg; struct wined3d_shader_register tmp_reg = ins->dst[0].reg;
...@@ -1949,7 +1949,7 @@ static void pshader_hw_texm3x2tex(const struct wined3d_shader_instruction *ins) ...@@ -1949,7 +1949,7 @@ static void pshader_hw_texm3x2tex(const struct wined3d_shader_instruction *ins)
IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) This->baseShader.device; IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) This->baseShader.device;
DWORD flags; DWORD flags;
DWORD reg = ins->dst[0].reg.idx; DWORD reg = ins->dst[0].reg.idx;
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
char dst_str[50]; char dst_str[50];
char src0_name[50]; char src0_name[50];
char dst_reg[50]; char dst_reg[50];
...@@ -1969,7 +1969,7 @@ static void pshader_hw_texm3x3pad(const struct wined3d_shader_instruction *ins) ...@@ -1969,7 +1969,7 @@ static void pshader_hw_texm3x3pad(const struct wined3d_shader_instruction *ins)
{ {
IWineD3DPixelShaderImpl *This = (IWineD3DPixelShaderImpl *)ins->ctx->shader; IWineD3DPixelShaderImpl *This = (IWineD3DPixelShaderImpl *)ins->ctx->shader;
DWORD reg = ins->dst[0].reg.idx; DWORD reg = ins->dst[0].reg.idx;
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
SHADER_PARSE_STATE* current_state = &This->baseShader.parse_state; SHADER_PARSE_STATE* current_state = &This->baseShader.parse_state;
char src0_name[50], dst_name[50]; char src0_name[50], dst_name[50];
struct wined3d_shader_register tmp_reg = ins->dst[0].reg; struct wined3d_shader_register tmp_reg = ins->dst[0].reg;
...@@ -1994,7 +1994,7 @@ static void pshader_hw_texm3x3tex(const struct wined3d_shader_instruction *ins) ...@@ -1994,7 +1994,7 @@ static void pshader_hw_texm3x3tex(const struct wined3d_shader_instruction *ins)
IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) This->baseShader.device; IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) This->baseShader.device;
DWORD flags; DWORD flags;
DWORD reg = ins->dst[0].reg.idx; DWORD reg = ins->dst[0].reg.idx;
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
SHADER_PARSE_STATE* current_state = &This->baseShader.parse_state; SHADER_PARSE_STATE* current_state = &This->baseShader.parse_state;
char dst_str[50]; char dst_str[50];
char src0_name[50], dst_name[50]; char src0_name[50], dst_name[50];
...@@ -2017,7 +2017,7 @@ static void pshader_hw_texm3x3vspec(const struct wined3d_shader_instruction *ins ...@@ -2017,7 +2017,7 @@ static void pshader_hw_texm3x3vspec(const struct wined3d_shader_instruction *ins
IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) This->baseShader.device; IWineD3DDeviceImpl* deviceImpl = (IWineD3DDeviceImpl*) This->baseShader.device;
DWORD flags; DWORD flags;
DWORD reg = ins->dst[0].reg.idx; DWORD reg = ins->dst[0].reg.idx;
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
SHADER_PARSE_STATE* current_state = &This->baseShader.parse_state; SHADER_PARSE_STATE* current_state = &This->baseShader.parse_state;
char dst_str[50]; char dst_str[50];
char src0_name[50]; char src0_name[50];
...@@ -2060,7 +2060,7 @@ static void pshader_hw_texm3x3spec(const struct wined3d_shader_instruction *ins) ...@@ -2060,7 +2060,7 @@ static void pshader_hw_texm3x3spec(const struct wined3d_shader_instruction *ins)
DWORD flags; DWORD flags;
DWORD reg = ins->dst[0].reg.idx; DWORD reg = ins->dst[0].reg.idx;
SHADER_PARSE_STATE* current_state = &This->baseShader.parse_state; SHADER_PARSE_STATE* current_state = &This->baseShader.parse_state;
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
char dst_str[50]; char dst_str[50];
char src0_name[50]; char src0_name[50];
char src1_name[50]; char src1_name[50];
...@@ -2098,7 +2098,7 @@ static void pshader_hw_texm3x3spec(const struct wined3d_shader_instruction *ins) ...@@ -2098,7 +2098,7 @@ static void pshader_hw_texm3x3spec(const struct wined3d_shader_instruction *ins)
static void pshader_hw_texdepth(const struct wined3d_shader_instruction *ins) static void pshader_hw_texdepth(const struct wined3d_shader_instruction *ins)
{ {
const struct wined3d_shader_dst_param *dst = &ins->dst[0]; const struct wined3d_shader_dst_param *dst = &ins->dst[0];
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
char dst_name[50]; char dst_name[50];
/* texdepth has an implicit destination, the fragment depth value. It's only parameter, /* texdepth has an implicit destination, the fragment depth value. It's only parameter,
...@@ -2128,7 +2128,7 @@ static void pshader_hw_texdepth(const struct wined3d_shader_instruction *ins) ...@@ -2128,7 +2128,7 @@ static void pshader_hw_texdepth(const struct wined3d_shader_instruction *ins)
* then perform a 1D texture lookup from stage dstregnum, place into dst. */ * then perform a 1D texture lookup from stage dstregnum, place into dst. */
static void pshader_hw_texdp3tex(const struct wined3d_shader_instruction *ins) static void pshader_hw_texdp3tex(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
DWORD sampler_idx = ins->dst[0].reg.idx; DWORD sampler_idx = ins->dst[0].reg.idx;
char src0[50]; char src0[50];
char dst_str[50]; char dst_str[50];
...@@ -2148,7 +2148,7 @@ static void pshader_hw_texdp3(const struct wined3d_shader_instruction *ins) ...@@ -2148,7 +2148,7 @@ static void pshader_hw_texdp3(const struct wined3d_shader_instruction *ins)
const struct wined3d_shader_dst_param *dst = &ins->dst[0]; const struct wined3d_shader_dst_param *dst = &ins->dst[0];
char src0[50]; char src0[50];
char dst_str[50]; char dst_str[50];
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
/* Handle output register */ /* Handle output register */
shader_arb_get_dst_param(ins, dst, dst_str); shader_arb_get_dst_param(ins, dst, dst_str);
...@@ -2161,7 +2161,7 @@ static void pshader_hw_texdp3(const struct wined3d_shader_instruction *ins) ...@@ -2161,7 +2161,7 @@ static void pshader_hw_texdp3(const struct wined3d_shader_instruction *ins)
static void pshader_hw_texm3x3(const struct wined3d_shader_instruction *ins) static void pshader_hw_texm3x3(const struct wined3d_shader_instruction *ins)
{ {
const struct wined3d_shader_dst_param *dst = &ins->dst[0]; const struct wined3d_shader_dst_param *dst = &ins->dst[0];
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
char dst_str[50], dst_name[50]; char dst_str[50], dst_name[50];
char src0[50]; char src0[50];
BOOL is_color; BOOL is_color;
...@@ -2180,7 +2180,7 @@ static void pshader_hw_texm3x3(const struct wined3d_shader_instruction *ins) ...@@ -2180,7 +2180,7 @@ static void pshader_hw_texm3x3(const struct wined3d_shader_instruction *ins)
*/ */
static void pshader_hw_texm3x2depth(const struct wined3d_shader_instruction *ins) static void pshader_hw_texm3x2depth(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
const struct wined3d_shader_dst_param *dst = &ins->dst[0]; const struct wined3d_shader_dst_param *dst = &ins->dst[0];
char src0[50], dst_name[50]; char src0[50], dst_name[50];
BOOL is_color; BOOL is_color;
...@@ -2257,7 +2257,7 @@ static void shader_hw_mnxn(const struct wined3d_shader_instruction *ins) ...@@ -2257,7 +2257,7 @@ static void shader_hw_mnxn(const struct wined3d_shader_instruction *ins)
static void shader_hw_rsq_rcp(const struct wined3d_shader_instruction *ins) static void shader_hw_rsq_rcp(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
const char *instruction; const char *instruction;
char dst[50]; char dst[50];
...@@ -2287,7 +2287,7 @@ static void shader_hw_rsq_rcp(const struct wined3d_shader_instruction *ins) ...@@ -2287,7 +2287,7 @@ static void shader_hw_rsq_rcp(const struct wined3d_shader_instruction *ins)
static void shader_hw_nrm(const struct wined3d_shader_instruction *ins) static void shader_hw_nrm(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
char dst_name[50]; char dst_name[50];
char src_name[50]; char src_name[50];
struct shader_arb_ctx_priv *priv = ins->ctx->backend_data; struct shader_arb_ctx_priv *priv = ins->ctx->backend_data;
...@@ -2312,7 +2312,7 @@ static void shader_hw_nrm(const struct wined3d_shader_instruction *ins) ...@@ -2312,7 +2312,7 @@ static void shader_hw_nrm(const struct wined3d_shader_instruction *ins)
static void shader_hw_lrp(const struct wined3d_shader_instruction *ins) static void shader_hw_lrp(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
char dst_name[50]; char dst_name[50];
char src_name[3][50]; char src_name[3][50];
...@@ -2338,7 +2338,7 @@ static void shader_hw_sincos(const struct wined3d_shader_instruction *ins) ...@@ -2338,7 +2338,7 @@ static void shader_hw_sincos(const struct wined3d_shader_instruction *ins)
* must contain fixed constants. So we need a separate function to filter those constants and * must contain fixed constants. So we need a separate function to filter those constants and
* can't use map2gl * can't use map2gl
*/ */
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
struct shader_arb_ctx_priv *priv = ins->ctx->backend_data; struct shader_arb_ctx_priv *priv = ins->ctx->backend_data;
const struct wined3d_shader_dst_param *dst = &ins->dst[0]; const struct wined3d_shader_dst_param *dst = &ins->dst[0];
char dst_name[50]; char dst_name[50];
...@@ -2441,7 +2441,7 @@ static void shader_hw_sincos(const struct wined3d_shader_instruction *ins) ...@@ -2441,7 +2441,7 @@ static void shader_hw_sincos(const struct wined3d_shader_instruction *ins)
static void shader_hw_sgn(const struct wined3d_shader_instruction *ins) static void shader_hw_sgn(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
char dst_name[50]; char dst_name[50];
char src_name[50]; char src_name[50];
struct shader_arb_ctx_priv *ctx = ins->ctx->backend_data; struct shader_arb_ctx_priv *ctx = ins->ctx->backend_data;
...@@ -2483,7 +2483,7 @@ static void shader_hw_sgn(const struct wined3d_shader_instruction *ins) ...@@ -2483,7 +2483,7 @@ static void shader_hw_sgn(const struct wined3d_shader_instruction *ins)
static void shader_hw_dsy(const struct wined3d_shader_instruction *ins) static void shader_hw_dsy(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
char src[50]; char src[50];
char dst[50]; char dst[50];
char dst_name[50]; char dst_name[50];
...@@ -2523,7 +2523,7 @@ static DWORD abs_modifier(DWORD mod, BOOL *need_abs) ...@@ -2523,7 +2523,7 @@ static DWORD abs_modifier(DWORD mod, BOOL *need_abs)
static void shader_hw_log_pow(const struct wined3d_shader_instruction *ins) static void shader_hw_log_pow(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
char src0[50], src1[50], dst[50]; char src0[50], src1[50], dst[50];
struct wined3d_shader_src_param src0_copy = ins->src[0]; struct wined3d_shader_src_param src0_copy = ins->src[0];
BOOL need_abs = FALSE; BOOL need_abs = FALSE;
...@@ -2571,7 +2571,7 @@ static void shader_hw_log_pow(const struct wined3d_shader_instruction *ins) ...@@ -2571,7 +2571,7 @@ static void shader_hw_log_pow(const struct wined3d_shader_instruction *ins)
static void shader_hw_loop(const struct wined3d_shader_instruction *ins) static void shader_hw_loop(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
char src_name[50]; char src_name[50];
BOOL vshader = shader_is_vshader_version(ins->ctx->reg_maps->shader_version.type); BOOL vshader = shader_is_vshader_version(ins->ctx->reg_maps->shader_version.type);
...@@ -2598,7 +2598,7 @@ static void shader_hw_loop(const struct wined3d_shader_instruction *ins) ...@@ -2598,7 +2598,7 @@ static void shader_hw_loop(const struct wined3d_shader_instruction *ins)
static void shader_hw_rep(const struct wined3d_shader_instruction *ins) static void shader_hw_rep(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
char src_name[50]; char src_name[50];
BOOL vshader = shader_is_vshader_version(ins->ctx->reg_maps->shader_version.type); BOOL vshader = shader_is_vshader_version(ins->ctx->reg_maps->shader_version.type);
...@@ -2625,7 +2625,7 @@ static void shader_hw_rep(const struct wined3d_shader_instruction *ins) ...@@ -2625,7 +2625,7 @@ static void shader_hw_rep(const struct wined3d_shader_instruction *ins)
static void shader_hw_endloop(const struct wined3d_shader_instruction *ins) static void shader_hw_endloop(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
BOOL vshader = shader_is_vshader_version(ins->ctx->reg_maps->shader_version.type); BOOL vshader = shader_is_vshader_version(ins->ctx->reg_maps->shader_version.type);
if(vshader) if(vshader)
...@@ -2648,7 +2648,7 @@ static void shader_hw_endloop(const struct wined3d_shader_instruction *ins) ...@@ -2648,7 +2648,7 @@ static void shader_hw_endloop(const struct wined3d_shader_instruction *ins)
static void shader_hw_endrep(const struct wined3d_shader_instruction *ins) static void shader_hw_endrep(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
BOOL vshader = shader_is_vshader_version(ins->ctx->reg_maps->shader_version.type); BOOL vshader = shader_is_vshader_version(ins->ctx->reg_maps->shader_version.type);
if(vshader) if(vshader)
...@@ -2683,7 +2683,7 @@ static const struct control_frame *find_last_loop(const struct shader_arb_ctx_pr ...@@ -2683,7 +2683,7 @@ static const struct control_frame *find_last_loop(const struct shader_arb_ctx_pr
static void shader_hw_break(const struct wined3d_shader_instruction *ins) static void shader_hw_break(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
const struct control_frame *control_frame = find_last_loop(ins->ctx->backend_data); const struct control_frame *control_frame = find_last_loop(ins->ctx->backend_data);
BOOL vshader = shader_is_vshader_version(ins->ctx->reg_maps->shader_version.type); BOOL vshader = shader_is_vshader_version(ins->ctx->reg_maps->shader_version.type);
...@@ -2731,7 +2731,7 @@ static COMPARISON_TYPE invert_compare(COMPARISON_TYPE flags) ...@@ -2731,7 +2731,7 @@ static COMPARISON_TYPE invert_compare(COMPARISON_TYPE flags)
static void shader_hw_breakc(const struct wined3d_shader_instruction *ins) static void shader_hw_breakc(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
BOOL vshader = shader_is_vshader_version(ins->ctx->reg_maps->shader_version.type); BOOL vshader = shader_is_vshader_version(ins->ctx->reg_maps->shader_version.type);
const struct control_frame *control_frame = find_last_loop(ins->ctx->backend_data); const struct control_frame *control_frame = find_last_loop(ins->ctx->backend_data);
char src_name0[50]; char src_name0[50];
...@@ -2758,7 +2758,7 @@ static void shader_hw_breakc(const struct wined3d_shader_instruction *ins) ...@@ -2758,7 +2758,7 @@ static void shader_hw_breakc(const struct wined3d_shader_instruction *ins)
static void shader_hw_ifc(const struct wined3d_shader_instruction *ins) static void shader_hw_ifc(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
struct shader_arb_ctx_priv *priv = ins->ctx->backend_data; struct shader_arb_ctx_priv *priv = ins->ctx->backend_data;
struct list *e = list_head(&priv->control_frames); struct list *e = list_head(&priv->control_frames);
struct control_frame *control_frame = LIST_ENTRY(e, struct control_frame, entry); struct control_frame *control_frame = LIST_ENTRY(e, struct control_frame, entry);
...@@ -2787,7 +2787,7 @@ static void shader_hw_ifc(const struct wined3d_shader_instruction *ins) ...@@ -2787,7 +2787,7 @@ static void shader_hw_ifc(const struct wined3d_shader_instruction *ins)
static void shader_hw_else(const struct wined3d_shader_instruction *ins) static void shader_hw_else(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
struct shader_arb_ctx_priv *priv = ins->ctx->backend_data; struct shader_arb_ctx_priv *priv = ins->ctx->backend_data;
struct list *e = list_head(&priv->control_frames); struct list *e = list_head(&priv->control_frames);
struct control_frame *control_frame = LIST_ENTRY(e, struct control_frame, entry); struct control_frame *control_frame = LIST_ENTRY(e, struct control_frame, entry);
...@@ -2807,7 +2807,7 @@ static void shader_hw_else(const struct wined3d_shader_instruction *ins) ...@@ -2807,7 +2807,7 @@ static void shader_hw_else(const struct wined3d_shader_instruction *ins)
static void shader_hw_endif(const struct wined3d_shader_instruction *ins) static void shader_hw_endif(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
struct shader_arb_ctx_priv *priv = ins->ctx->backend_data; struct shader_arb_ctx_priv *priv = ins->ctx->backend_data;
struct list *e = list_head(&priv->control_frames); struct list *e = list_head(&priv->control_frames);
struct control_frame *control_frame = LIST_ENTRY(e, struct control_frame, entry); struct control_frame *control_frame = LIST_ENTRY(e, struct control_frame, entry);
...@@ -2867,7 +2867,7 @@ static void shader_hw_texldl(const struct wined3d_shader_instruction *ins) ...@@ -2867,7 +2867,7 @@ static void shader_hw_texldl(const struct wined3d_shader_instruction *ins)
static void shader_hw_label(const struct wined3d_shader_instruction *ins) static void shader_hw_label(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
struct shader_arb_ctx_priv *priv = ins->ctx->backend_data; struct shader_arb_ctx_priv *priv = ins->ctx->backend_data;
priv->in_main_func = FALSE; priv->in_main_func = FALSE;
...@@ -2879,8 +2879,8 @@ static void shader_hw_label(const struct wined3d_shader_instruction *ins) ...@@ -2879,8 +2879,8 @@ static void shader_hw_label(const struct wined3d_shader_instruction *ins)
shader_addline(buffer, "l%u:\n", ins->src[0].reg.idx); shader_addline(buffer, "l%u:\n", ins->src[0].reg.idx);
} }
static void vshader_add_footer(IWineD3DVertexShaderImpl *This, SHADER_BUFFER *buffer, const struct arb_vs_compile_args *args, static void vshader_add_footer(IWineD3DVertexShaderImpl *This, struct wined3d_shader_buffer *buffer,
struct shader_arb_ctx_priv *priv_ctx) const struct arb_vs_compile_args *args, struct shader_arb_ctx_priv *priv_ctx)
{ {
const shader_reg_maps *reg_maps = &This->baseShader.reg_maps; const shader_reg_maps *reg_maps = &This->baseShader.reg_maps;
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)This->baseShader.device; IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)This->baseShader.device;
...@@ -2966,7 +2966,7 @@ static void vshader_add_footer(IWineD3DVertexShaderImpl *This, SHADER_BUFFER *bu ...@@ -2966,7 +2966,7 @@ static void vshader_add_footer(IWineD3DVertexShaderImpl *This, SHADER_BUFFER *bu
static void shader_hw_ret(const struct wined3d_shader_instruction *ins) static void shader_hw_ret(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
struct shader_arb_ctx_priv *priv = ins->ctx->backend_data; struct shader_arb_ctx_priv *priv = ins->ctx->backend_data;
IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *) ins->ctx->shader; IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *) ins->ctx->shader;
BOOL vshader = shader_is_vshader_version(ins->ctx->reg_maps->shader_version.type); BOOL vshader = shader_is_vshader_version(ins->ctx->reg_maps->shader_version.type);
...@@ -2983,7 +2983,7 @@ static void shader_hw_ret(const struct wined3d_shader_instruction *ins) ...@@ -2983,7 +2983,7 @@ static void shader_hw_ret(const struct wined3d_shader_instruction *ins)
static void shader_hw_call(const struct wined3d_shader_instruction *ins) static void shader_hw_call(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
shader_addline(buffer, "CAL l%u;\n", ins->src[0].reg.idx); shader_addline(buffer, "CAL l%u;\n", ins->src[0].reg.idx);
} }
...@@ -3063,8 +3063,9 @@ static GLuint create_arb_blt_fragment_program(const WineD3D_GL_Info *gl_info, en ...@@ -3063,8 +3063,9 @@ static GLuint create_arb_blt_fragment_program(const WineD3D_GL_Info *gl_info, en
return program_id; return program_id;
} }
static void arbfp_add_sRGB_correction(SHADER_BUFFER *buffer, const char *fragcolor, const char *tmp1, static void arbfp_add_sRGB_correction(struct wined3d_shader_buffer *buffer, const char *fragcolor,
const char *tmp2, const char *tmp3, const char *tmp4, BOOL condcode) { const char *tmp1, const char *tmp2, const char *tmp3, const char *tmp4, BOOL condcode)
{
/* Perform sRGB write correction. See GLX_EXT_framebuffer_sRGB */ /* Perform sRGB write correction. See GLX_EXT_framebuffer_sRGB */
if(condcode) if(condcode)
...@@ -3196,8 +3197,8 @@ static void init_ps_input(const IWineD3DPixelShaderImpl *This, const struct arb_ ...@@ -3196,8 +3197,8 @@ static void init_ps_input(const IWineD3DPixelShaderImpl *This, const struct arb_
} }
/* GL locking is done by the caller */ /* GL locking is done by the caller */
static GLuint shader_arb_generate_pshader(IWineD3DPixelShaderImpl *This, static GLuint shader_arb_generate_pshader(IWineD3DPixelShaderImpl *This, struct wined3d_shader_buffer *buffer,
SHADER_BUFFER *buffer, const struct arb_ps_compile_args *args, struct arb_ps_compiled_shader *compiled) const struct arb_ps_compile_args *args, struct arb_ps_compiled_shader *compiled)
{ {
const shader_reg_maps* reg_maps = &This->baseShader.reg_maps; const shader_reg_maps* reg_maps = &This->baseShader.reg_maps;
CONST DWORD *function = This->baseShader.function; CONST DWORD *function = This->baseShader.function;
...@@ -3764,8 +3765,8 @@ static void init_output_registers(IWineD3DVertexShaderImpl *shader, DWORD sig_nu ...@@ -3764,8 +3765,8 @@ static void init_output_registers(IWineD3DVertexShaderImpl *shader, DWORD sig_nu
} }
/* GL locking is done by the caller */ /* GL locking is done by the caller */
static GLuint shader_arb_generate_vshader(IWineD3DVertexShaderImpl *This, static GLuint shader_arb_generate_vshader(IWineD3DVertexShaderImpl *This, struct wined3d_shader_buffer *buffer,
SHADER_BUFFER *buffer, const struct arb_vs_compile_args *args, struct arb_vs_compiled_shader *compiled) const struct arb_vs_compile_args *args, struct arb_vs_compiled_shader *compiled)
{ {
const shader_reg_maps *reg_maps = &This->baseShader.reg_maps; const shader_reg_maps *reg_maps = &This->baseShader.reg_maps;
CONST DWORD *function = This->baseShader.function; CONST DWORD *function = This->baseShader.function;
...@@ -3948,7 +3949,7 @@ static struct arb_ps_compiled_shader *find_arb_pshader(IWineD3DPixelShaderImpl * ...@@ -3948,7 +3949,7 @@ static struct arb_ps_compiled_shader *find_arb_pshader(IWineD3DPixelShaderImpl *
UINT i; UINT i;
DWORD new_size; DWORD new_size;
struct arb_ps_compiled_shader *new_array; struct arb_ps_compiled_shader *new_array;
SHADER_BUFFER buffer; struct wined3d_shader_buffer buffer;
struct arb_pshader_private *shader_data; struct arb_pshader_private *shader_data;
GLuint ret; GLuint ret;
...@@ -4032,7 +4033,7 @@ static struct arb_vs_compiled_shader *find_arb_vshader(IWineD3DVertexShaderImpl ...@@ -4032,7 +4033,7 @@ static struct arb_vs_compiled_shader *find_arb_vshader(IWineD3DVertexShaderImpl
DWORD new_size; DWORD new_size;
struct arb_vs_compiled_shader *new_array; struct arb_vs_compiled_shader *new_array;
DWORD use_map = ((IWineD3DDeviceImpl *)shader->baseShader.device)->strided_streams.use_map; DWORD use_map = ((IWineD3DDeviceImpl *)shader->baseShader.device)->strided_streams.use_map;
SHADER_BUFFER buffer; struct wined3d_shader_buffer buffer;
struct arb_vshader_private *shader_data; struct arb_vshader_private *shader_data;
GLuint ret; GLuint ret;
const WineD3D_GL_Info *gl_info = &((IWineD3DDeviceImpl *)shader->baseShader.device)->adapter->gl_info; const WineD3D_GL_Info *gl_info = &((IWineD3DDeviceImpl *)shader->baseShader.device)->adapter->gl_info;
...@@ -4521,7 +4522,7 @@ static BOOL shader_arb_color_fixup_supported(struct color_fixup_desc fixup) ...@@ -4521,7 +4522,7 @@ static BOOL shader_arb_color_fixup_supported(struct color_fixup_desc fixup)
static void shader_arb_add_instruction_modifiers(const struct wined3d_shader_instruction *ins) { static void shader_arb_add_instruction_modifiers(const struct wined3d_shader_instruction *ins) {
DWORD shift; DWORD shift;
char write_mask[20], regstr[50]; char write_mask[20], regstr[50];
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
BOOL is_color = FALSE; BOOL is_color = FALSE;
const struct wined3d_shader_dst_param *dst; const struct wined3d_shader_dst_param *dst;
...@@ -4800,7 +4801,7 @@ static void shader_arb_handle_instruction(const struct wined3d_shader_instructio ...@@ -4800,7 +4801,7 @@ static void shader_arb_handle_instruction(const struct wined3d_shader_instructio
struct shader_arb_ctx_priv *priv = ins->ctx->backend_data; struct shader_arb_ctx_priv *priv = ins->ctx->backend_data;
IWineD3DBaseShaderImpl *This = (IWineD3DBaseShaderImpl *)ins->ctx->shader; IWineD3DBaseShaderImpl *This = (IWineD3DBaseShaderImpl *)ins->ctx->shader;
struct control_frame *control_frame; struct control_frame *control_frame;
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
BOOL bool_const; BOOL bool_const;
if(ins->handler_idx == WINED3DSIH_LOOP || ins->handler_idx == WINED3DSIH_REP) if(ins->handler_idx == WINED3DSIH_LOOP || ins->handler_idx == WINED3DSIH_REP)
...@@ -5262,7 +5263,8 @@ static void tex_bumpenvlum_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock ...@@ -5262,7 +5263,8 @@ static void tex_bumpenvlum_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock
checkGLcall("glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_LUMINANCE(stage), param)"); checkGLcall("glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_LUMINANCE(stage), param)");
} }
static const char *get_argreg(SHADER_BUFFER *buffer, DWORD argnum, unsigned int stage, DWORD arg) { static const char *get_argreg(struct wined3d_shader_buffer *buffer, DWORD argnum, unsigned int stage, DWORD arg)
{
const char *ret; const char *ret;
if(arg == ARG_UNUSED) return "unused"; /* This is the marker for unused registers */ if(arg == ARG_UNUSED) return "unused"; /* This is the marker for unused registers */
...@@ -5333,8 +5335,9 @@ static const char *get_argreg(SHADER_BUFFER *buffer, DWORD argnum, unsigned int ...@@ -5333,8 +5335,9 @@ static const char *get_argreg(SHADER_BUFFER *buffer, DWORD argnum, unsigned int
return ret; return ret;
} }
static void gen_ffp_instr(SHADER_BUFFER *buffer, unsigned int stage, BOOL color, BOOL alpha, static void gen_ffp_instr(struct wined3d_shader_buffer *buffer, unsigned int stage, BOOL color,
DWORD dst, DWORD op, DWORD dw_arg0, DWORD dw_arg1, DWORD dw_arg2) { BOOL alpha, DWORD dst, DWORD op, DWORD dw_arg0, DWORD dw_arg1, DWORD dw_arg2)
{
const char *dstmask, *dstreg, *arg0, *arg1, *arg2; const char *dstmask, *dstreg, *arg0, *arg1, *arg2;
unsigned int mul = 1; unsigned int mul = 1;
BOOL mul_final_dest = FALSE; BOOL mul_final_dest = FALSE;
...@@ -5475,7 +5478,7 @@ static void gen_ffp_instr(SHADER_BUFFER *buffer, unsigned int stage, BOOL color, ...@@ -5475,7 +5478,7 @@ static void gen_ffp_instr(SHADER_BUFFER *buffer, unsigned int stage, BOOL color,
static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, IWineD3DStateBlockImpl *stateblock) static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, IWineD3DStateBlockImpl *stateblock)
{ {
unsigned int stage; unsigned int stage;
SHADER_BUFFER buffer; struct wined3d_shader_buffer buffer;
BOOL tex_read[MAX_TEXTURES] = {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE}; BOOL tex_read[MAX_TEXTURES] = {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE};
BOOL bump_used[MAX_TEXTURES] = {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE}; BOOL bump_used[MAX_TEXTURES] = {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE};
BOOL luminance_used[MAX_TEXTURES] = {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE}; BOOL luminance_used[MAX_TEXTURES] = {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE};
...@@ -6058,7 +6061,8 @@ static void arbfp_blit_free(IWineD3DDevice *iface) { ...@@ -6058,7 +6061,8 @@ static void arbfp_blit_free(IWineD3DDevice *iface) {
LEAVE_GL(); LEAVE_GL();
} }
static BOOL gen_planar_yuv_read(SHADER_BUFFER *buffer, enum yuv_fixup yuv_fixup, GLenum textype, char *luminance) static BOOL gen_planar_yuv_read(struct wined3d_shader_buffer *buffer, enum yuv_fixup yuv_fixup,
GLenum textype, char *luminance)
{ {
char chroma; char chroma;
const char *tex, *texinstr; const char *tex, *texinstr;
...@@ -6145,7 +6149,7 @@ static BOOL gen_planar_yuv_read(SHADER_BUFFER *buffer, enum yuv_fixup yuv_fixup, ...@@ -6145,7 +6149,7 @@ static BOOL gen_planar_yuv_read(SHADER_BUFFER *buffer, enum yuv_fixup yuv_fixup,
return TRUE; return TRUE;
} }
static BOOL gen_yv12_read(SHADER_BUFFER *buffer, GLenum textype, char *luminance) static BOOL gen_yv12_read(struct wined3d_shader_buffer *buffer, GLenum textype, char *luminance)
{ {
const char *tex; const char *tex;
...@@ -6295,7 +6299,7 @@ static BOOL gen_yv12_read(SHADER_BUFFER *buffer, GLenum textype, char *luminance ...@@ -6295,7 +6299,7 @@ static BOOL gen_yv12_read(SHADER_BUFFER *buffer, GLenum textype, char *luminance
static GLuint gen_yuv_shader(IWineD3DDeviceImpl *device, enum yuv_fixup yuv_fixup, GLenum textype) static GLuint gen_yuv_shader(IWineD3DDeviceImpl *device, enum yuv_fixup yuv_fixup, GLenum textype)
{ {
GLenum shader; GLenum shader;
SHADER_BUFFER buffer; struct wined3d_shader_buffer buffer;
char luminance_component; char luminance_component;
struct arbfp_blit_priv *priv = device->blit_priv; struct arbfp_blit_priv *priv = device->blit_priv;
......
...@@ -138,7 +138,7 @@ const struct wined3d_shader_frontend *shader_select_frontend(DWORD version_token ...@@ -138,7 +138,7 @@ const struct wined3d_shader_frontend *shader_select_frontend(DWORD version_token
} }
} }
void shader_buffer_clear(struct SHADER_BUFFER *buffer) void shader_buffer_clear(struct wined3d_shader_buffer *buffer)
{ {
buffer->buffer[0] = '\0'; buffer->buffer[0] = '\0';
buffer->bsize = 0; buffer->bsize = 0;
...@@ -146,18 +146,18 @@ void shader_buffer_clear(struct SHADER_BUFFER *buffer) ...@@ -146,18 +146,18 @@ void shader_buffer_clear(struct SHADER_BUFFER *buffer)
buffer->newline = TRUE; buffer->newline = TRUE;
} }
void shader_buffer_init(struct SHADER_BUFFER *buffer) void shader_buffer_init(struct wined3d_shader_buffer *buffer)
{ {
buffer->buffer = HeapAlloc(GetProcessHeap(), 0, SHADER_PGMSIZE); buffer->buffer = HeapAlloc(GetProcessHeap(), 0, SHADER_PGMSIZE);
shader_buffer_clear(buffer); shader_buffer_clear(buffer);
} }
void shader_buffer_free(struct SHADER_BUFFER *buffer) void shader_buffer_free(struct wined3d_shader_buffer *buffer)
{ {
HeapFree(GetProcessHeap(), 0, buffer->buffer); HeapFree(GetProcessHeap(), 0, buffer->buffer);
} }
int shader_vaddline(SHADER_BUFFER* buffer, const char *format, va_list args) int shader_vaddline(struct wined3d_shader_buffer *buffer, const char *format, va_list args)
{ {
char* base = buffer->buffer + buffer->bsize; char* base = buffer->buffer + buffer->bsize;
int rc; int rc;
...@@ -187,7 +187,7 @@ int shader_vaddline(SHADER_BUFFER* buffer, const char *format, va_list args) ...@@ -187,7 +187,7 @@ int shader_vaddline(SHADER_BUFFER* buffer, const char *format, va_list args)
return 0; return 0;
} }
int shader_addline(SHADER_BUFFER* buffer, const char *format, ...) int shader_addline(struct wined3d_shader_buffer *buffer, const char *format, ...)
{ {
int ret; int ret;
va_list args; va_list args;
...@@ -1034,7 +1034,7 @@ void shader_dump_src_param(const struct wined3d_shader_src_param *param, ...@@ -1034,7 +1034,7 @@ void shader_dump_src_param(const struct wined3d_shader_src_param *param,
/* Shared code in order to generate the bulk of the shader string. /* Shared code in order to generate the bulk of the shader string.
* NOTE: A description of how to parse tokens can be found on msdn */ * NOTE: A description of how to parse tokens can be found on msdn */
void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER *buffer, void shader_generate_main(IWineD3DBaseShader *iface, struct wined3d_shader_buffer *buffer,
const shader_reg_maps *reg_maps, const DWORD *pFunction, void *backend_ctx) const shader_reg_maps *reg_maps, const DWORD *pFunction, void *backend_ctx)
{ {
IWineD3DBaseShaderImpl* This = (IWineD3DBaseShaderImpl*) iface; IWineD3DBaseShaderImpl* This = (IWineD3DBaseShaderImpl*) iface;
......
...@@ -83,7 +83,7 @@ struct constant_heap ...@@ -83,7 +83,7 @@ struct constant_heap
/* GLSL shader private data */ /* GLSL shader private data */
struct shader_glsl_priv { struct shader_glsl_priv {
struct SHADER_BUFFER shader_buffer; struct wined3d_shader_buffer shader_buffer;
struct wine_rb_tree program_lookup; struct wine_rb_tree program_lookup;
struct glsl_shader_prog_link *glsl_program; struct glsl_shader_prog_link *glsl_program;
struct constant_heap vconst_heap; struct constant_heap vconst_heap;
...@@ -783,7 +783,7 @@ static unsigned int vec4_varyings(DWORD shader_major, const WineD3D_GL_Info *gl_ ...@@ -783,7 +783,7 @@ static unsigned int vec4_varyings(DWORD shader_major, const WineD3D_GL_Info *gl_
/** Generate the variable & register declarations for the GLSL output target */ /** Generate the variable & register declarations for the GLSL output target */
static void shader_generate_glsl_declarations(IWineD3DBaseShader *iface, const shader_reg_maps *reg_maps, static void shader_generate_glsl_declarations(IWineD3DBaseShader *iface, const shader_reg_maps *reg_maps,
SHADER_BUFFER *buffer, const WineD3D_GL_Info *gl_info, struct wined3d_shader_buffer *buffer, const WineD3D_GL_Info *gl_info,
struct shader_glsl_ctx_priv *ctx_priv) struct shader_glsl_ctx_priv *ctx_priv)
{ {
IWineD3DBaseShaderImpl* This = (IWineD3DBaseShaderImpl*) iface; IWineD3DBaseShaderImpl* This = (IWineD3DBaseShaderImpl*) iface;
...@@ -1455,7 +1455,7 @@ static DWORD shader_glsl_add_dst_param(const struct wined3d_shader_instruction * ...@@ -1455,7 +1455,7 @@ static DWORD shader_glsl_add_dst_param(const struct wined3d_shader_instruction *
} }
/* Append the destination part of the instruction to the buffer, return the effective write mask */ /* Append the destination part of the instruction to the buffer, return the effective write mask */
static DWORD shader_glsl_append_dst_ext(SHADER_BUFFER *buffer, static DWORD shader_glsl_append_dst_ext(struct wined3d_shader_buffer *buffer,
const struct wined3d_shader_instruction *ins, const struct wined3d_shader_dst_param *dst) const struct wined3d_shader_instruction *ins, const struct wined3d_shader_dst_param *dst)
{ {
glsl_dst_param_t glsl_dst; glsl_dst_param_t glsl_dst;
...@@ -1468,7 +1468,7 @@ static DWORD shader_glsl_append_dst_ext(SHADER_BUFFER *buffer, ...@@ -1468,7 +1468,7 @@ static DWORD shader_glsl_append_dst_ext(SHADER_BUFFER *buffer,
} }
/* Append the destination part of the instruction to the buffer, return the effective write mask */ /* Append the destination part of the instruction to the buffer, return the effective write mask */
static DWORD shader_glsl_append_dst(SHADER_BUFFER *buffer, const struct wined3d_shader_instruction *ins) static DWORD shader_glsl_append_dst(struct wined3d_shader_buffer *buffer, const struct wined3d_shader_instruction *ins)
{ {
return shader_glsl_append_dst_ext(buffer, ins, &ins->dst[0]); return shader_glsl_append_dst_ext(buffer, ins, &ins->dst[0]);
} }
...@@ -1764,7 +1764,7 @@ static void PRINTF_ATTR(8, 9) shader_glsl_gen_sample_code(const struct wined3d_s ...@@ -1764,7 +1764,7 @@ static void PRINTF_ATTR(8, 9) shader_glsl_gen_sample_code(const struct wined3d_s
/* Generate GLSL arithmetic functions (dst = src1 + src2) */ /* Generate GLSL arithmetic functions (dst = src1 + src2) */
static void shader_glsl_arith(const struct wined3d_shader_instruction *ins) static void shader_glsl_arith(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
glsl_src_param_t src0_param; glsl_src_param_t src0_param;
glsl_src_param_t src1_param; glsl_src_param_t src1_param;
DWORD write_mask; DWORD write_mask;
...@@ -1791,7 +1791,7 @@ static void shader_glsl_arith(const struct wined3d_shader_instruction *ins) ...@@ -1791,7 +1791,7 @@ static void shader_glsl_arith(const struct wined3d_shader_instruction *ins)
/* Process the WINED3DSIO_MOV opcode using GLSL (dst = src) */ /* Process the WINED3DSIO_MOV opcode using GLSL (dst = src) */
static void shader_glsl_mov(const struct wined3d_shader_instruction *ins) static void shader_glsl_mov(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
glsl_src_param_t src0_param; glsl_src_param_t src0_param;
DWORD write_mask; DWORD write_mask;
...@@ -1829,7 +1829,7 @@ static void shader_glsl_mov(const struct wined3d_shader_instruction *ins) ...@@ -1829,7 +1829,7 @@ static void shader_glsl_mov(const struct wined3d_shader_instruction *ins)
/* Process the dot product operators DP3 and DP4 in GLSL (dst = dot(src0, src1)) */ /* Process the dot product operators DP3 and DP4 in GLSL (dst = dot(src0, src1)) */
static void shader_glsl_dot(const struct wined3d_shader_instruction *ins) static void shader_glsl_dot(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
glsl_src_param_t src0_param; glsl_src_param_t src0_param;
glsl_src_param_t src1_param; glsl_src_param_t src1_param;
DWORD dst_write_mask, src_write_mask; DWORD dst_write_mask, src_write_mask;
...@@ -1877,7 +1877,7 @@ static void shader_glsl_cross(const struct wined3d_shader_instruction *ins) ...@@ -1877,7 +1877,7 @@ static void shader_glsl_cross(const struct wined3d_shader_instruction *ins)
* GLSL uses the value as-is. */ * GLSL uses the value as-is. */
static void shader_glsl_pow(const struct wined3d_shader_instruction *ins) static void shader_glsl_pow(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
glsl_src_param_t src0_param; glsl_src_param_t src0_param;
glsl_src_param_t src1_param; glsl_src_param_t src1_param;
DWORD dst_write_mask; DWORD dst_write_mask;
...@@ -1901,7 +1901,7 @@ static void shader_glsl_pow(const struct wined3d_shader_instruction *ins) ...@@ -1901,7 +1901,7 @@ static void shader_glsl_pow(const struct wined3d_shader_instruction *ins)
* GLSL uses the value as-is. */ * GLSL uses the value as-is. */
static void shader_glsl_log(const struct wined3d_shader_instruction *ins) static void shader_glsl_log(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
glsl_src_param_t src0_param; glsl_src_param_t src0_param;
DWORD dst_write_mask; DWORD dst_write_mask;
unsigned int dst_size; unsigned int dst_size;
...@@ -1921,7 +1921,7 @@ static void shader_glsl_log(const struct wined3d_shader_instruction *ins) ...@@ -1921,7 +1921,7 @@ static void shader_glsl_log(const struct wined3d_shader_instruction *ins)
/* Map the opcode 1-to-1 to the GL code (arg->dst = instruction(src0, src1, ...) */ /* Map the opcode 1-to-1 to the GL code (arg->dst = instruction(src0, src1, ...) */
static void shader_glsl_map2gl(const struct wined3d_shader_instruction *ins) static void shader_glsl_map2gl(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
glsl_src_param_t src_param; glsl_src_param_t src_param;
const char *instruction; const char *instruction;
DWORD write_mask; DWORD write_mask;
...@@ -2025,7 +2025,7 @@ static void shader_glsl_rcp(const struct wined3d_shader_instruction *ins) ...@@ -2025,7 +2025,7 @@ static void shader_glsl_rcp(const struct wined3d_shader_instruction *ins)
static void shader_glsl_rsq(const struct wined3d_shader_instruction *ins) static void shader_glsl_rsq(const struct wined3d_shader_instruction *ins)
{ {
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
glsl_src_param_t src_param; glsl_src_param_t src_param;
DWORD write_mask; DWORD write_mask;
unsigned int mask_size; unsigned int mask_size;
...@@ -2770,7 +2770,7 @@ static void shader_glsl_texldl(const struct wined3d_shader_instruction *ins) ...@@ -2770,7 +2770,7 @@ static void shader_glsl_texldl(const struct wined3d_shader_instruction *ins)
static void pshader_glsl_texcoord(const struct wined3d_shader_instruction *ins) static void pshader_glsl_texcoord(const struct wined3d_shader_instruction *ins)
{ {
/* FIXME: Make this work for more than just 2D textures */ /* FIXME: Make this work for more than just 2D textures */
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
DWORD write_mask = shader_glsl_append_dst(ins->ctx->buffer, ins); DWORD write_mask = shader_glsl_append_dst(ins->ctx->buffer, ins);
if (!(ins->ctx->reg_maps->shader_version.major == 1 && ins->ctx->reg_maps->shader_version.minor == 4)) if (!(ins->ctx->reg_maps->shader_version.major == 1 && ins->ctx->reg_maps->shader_version.minor == 4))
...@@ -2920,7 +2920,7 @@ static void pshader_glsl_texm3x2pad(const struct wined3d_shader_instruction *ins ...@@ -2920,7 +2920,7 @@ static void pshader_glsl_texm3x2pad(const struct wined3d_shader_instruction *ins
{ {
DWORD src_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2; DWORD src_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2;
DWORD reg = ins->dst[0].reg.idx; DWORD reg = ins->dst[0].reg.idx;
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
glsl_src_param_t src0_param; glsl_src_param_t src0_param;
shader_glsl_add_src_param(ins, &ins->src[0], src_mask, &src0_param); shader_glsl_add_src_param(ins, &ins->src[0], src_mask, &src0_param);
...@@ -2934,7 +2934,7 @@ static void pshader_glsl_texm3x3pad(const struct wined3d_shader_instruction *ins ...@@ -2934,7 +2934,7 @@ static void pshader_glsl_texm3x3pad(const struct wined3d_shader_instruction *ins
IWineD3DPixelShaderImpl *shader = (IWineD3DPixelShaderImpl *)ins->ctx->shader; IWineD3DPixelShaderImpl *shader = (IWineD3DPixelShaderImpl *)ins->ctx->shader;
DWORD src_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2; DWORD src_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2;
DWORD reg = ins->dst[0].reg.idx; DWORD reg = ins->dst[0].reg.idx;
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
SHADER_PARSE_STATE* current_state = &shader->baseShader.parse_state; SHADER_PARSE_STATE* current_state = &shader->baseShader.parse_state;
glsl_src_param_t src0_param; glsl_src_param_t src0_param;
...@@ -2947,7 +2947,7 @@ static void pshader_glsl_texm3x2tex(const struct wined3d_shader_instruction *ins ...@@ -2947,7 +2947,7 @@ static void pshader_glsl_texm3x2tex(const struct wined3d_shader_instruction *ins
{ {
DWORD src_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2; DWORD src_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2;
DWORD reg = ins->dst[0].reg.idx; DWORD reg = ins->dst[0].reg.idx;
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
glsl_src_param_t src0_param; glsl_src_param_t src0_param;
WINED3DSAMPLER_TEXTURE_TYPE sampler_type = ins->ctx->reg_maps->sampler_type[reg]; WINED3DSAMPLER_TEXTURE_TYPE sampler_type = ins->ctx->reg_maps->sampler_type[reg];
glsl_sample_function_t sample_function; glsl_sample_function_t sample_function;
...@@ -3013,7 +3013,7 @@ static void pshader_glsl_texm3x3spec(const struct wined3d_shader_instruction *in ...@@ -3013,7 +3013,7 @@ static void pshader_glsl_texm3x3spec(const struct wined3d_shader_instruction *in
DWORD reg = ins->dst[0].reg.idx; DWORD reg = ins->dst[0].reg.idx;
glsl_src_param_t src0_param; glsl_src_param_t src0_param;
glsl_src_param_t src1_param; glsl_src_param_t src1_param;
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
SHADER_PARSE_STATE* current_state = &shader->baseShader.parse_state; SHADER_PARSE_STATE* current_state = &shader->baseShader.parse_state;
WINED3DSAMPLER_TEXTURE_TYPE stype = ins->ctx->reg_maps->sampler_type[reg]; WINED3DSAMPLER_TEXTURE_TYPE stype = ins->ctx->reg_maps->sampler_type[reg];
DWORD src_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2; DWORD src_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2;
...@@ -3042,7 +3042,7 @@ static void pshader_glsl_texm3x3vspec(const struct wined3d_shader_instruction *i ...@@ -3042,7 +3042,7 @@ static void pshader_glsl_texm3x3vspec(const struct wined3d_shader_instruction *i
{ {
IWineD3DPixelShaderImpl *shader = (IWineD3DPixelShaderImpl *)ins->ctx->shader; IWineD3DPixelShaderImpl *shader = (IWineD3DPixelShaderImpl *)ins->ctx->shader;
DWORD reg = ins->dst[0].reg.idx; DWORD reg = ins->dst[0].reg.idx;
SHADER_BUFFER *buffer = ins->ctx->buffer; struct wined3d_shader_buffer *buffer = ins->ctx->buffer;
SHADER_PARSE_STATE* current_state = &shader->baseShader.parse_state; SHADER_PARSE_STATE* current_state = &shader->baseShader.parse_state;
glsl_src_param_t src0_param; glsl_src_param_t src0_param;
DWORD src_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2; DWORD src_mask = WINED3DSP_WRITEMASK_0 | WINED3DSP_WRITEMASK_1 | WINED3DSP_WRITEMASK_2;
...@@ -3240,7 +3240,7 @@ static void pshader_glsl_dp2add(const struct wined3d_shader_instruction *ins) ...@@ -3240,7 +3240,7 @@ static void pshader_glsl_dp2add(const struct wined3d_shader_instruction *ins)
} }
} }
static void pshader_glsl_input_pack(IWineD3DPixelShader *iface, SHADER_BUFFER *buffer, static void pshader_glsl_input_pack(IWineD3DPixelShader *iface, struct wined3d_shader_buffer *buffer,
const struct wined3d_shader_signature_element *input_signature, const struct shader_reg_maps *reg_maps, const struct wined3d_shader_signature_element *input_signature, const struct shader_reg_maps *reg_maps,
enum vertexprocessing_mode vertexprocessing) enum vertexprocessing_mode vertexprocessing)
{ {
...@@ -3343,7 +3343,7 @@ static void delete_glsl_program_entry(struct shader_glsl_priv *priv, const WineD ...@@ -3343,7 +3343,7 @@ static void delete_glsl_program_entry(struct shader_glsl_priv *priv, const WineD
HeapFree(GetProcessHeap(), 0, entry); HeapFree(GetProcessHeap(), 0, entry);
} }
static void handle_ps3_input(SHADER_BUFFER *buffer, const WineD3D_GL_Info *gl_info, const DWORD *map, static void handle_ps3_input(struct wined3d_shader_buffer *buffer, const WineD3D_GL_Info *gl_info, const DWORD *map,
const struct wined3d_shader_signature_element *input_signature, const struct shader_reg_maps *reg_maps_in, const struct wined3d_shader_signature_element *input_signature, const struct shader_reg_maps *reg_maps_in,
const struct wined3d_shader_signature_element *output_signature, const struct shader_reg_maps *reg_maps_out) const struct wined3d_shader_signature_element *output_signature, const struct shader_reg_maps *reg_maps_out)
{ {
...@@ -3505,7 +3505,7 @@ static void handle_ps3_input(SHADER_BUFFER *buffer, const WineD3D_GL_Info *gl_in ...@@ -3505,7 +3505,7 @@ static void handle_ps3_input(SHADER_BUFFER *buffer, const WineD3D_GL_Info *gl_in
} }
/* GL locking is done by the caller */ /* GL locking is done by the caller */
static GLhandleARB generate_param_reorder_function(struct SHADER_BUFFER *buffer, static GLhandleARB generate_param_reorder_function(struct wined3d_shader_buffer *buffer,
IWineD3DVertexShader *vertexshader, IWineD3DPixelShader *pixelshader, const WineD3D_GL_Info *gl_info) IWineD3DVertexShader *vertexshader, IWineD3DPixelShader *pixelshader, const WineD3D_GL_Info *gl_info)
{ {
GLhandleARB ret = 0; GLhandleARB ret = 0;
...@@ -3671,8 +3671,8 @@ static void hardcode_local_constants(IWineD3DBaseShaderImpl *shader, const WineD ...@@ -3671,8 +3671,8 @@ static void hardcode_local_constants(IWineD3DBaseShaderImpl *shader, const WineD
} }
/* GL locking is done by the caller */ /* GL locking is done by the caller */
static GLuint shader_glsl_generate_pshader(IWineD3DPixelShaderImpl *This, static GLuint shader_glsl_generate_pshader(IWineD3DPixelShaderImpl *This, struct wined3d_shader_buffer *buffer,
SHADER_BUFFER *buffer, const struct ps_compile_args *args, struct ps_np2fixup_info *np2fixup_info) const struct ps_compile_args *args, struct ps_np2fixup_info *np2fixup_info)
{ {
const struct shader_reg_maps *reg_maps = &This->baseShader.reg_maps; const struct shader_reg_maps *reg_maps = &This->baseShader.reg_maps;
CONST DWORD *function = This->baseShader.function; CONST DWORD *function = This->baseShader.function;
...@@ -3773,7 +3773,7 @@ static GLuint shader_glsl_generate_pshader(IWineD3DPixelShaderImpl *This, ...@@ -3773,7 +3773,7 @@ static GLuint shader_glsl_generate_pshader(IWineD3DPixelShaderImpl *This,
/* GL locking is done by the caller */ /* GL locking is done by the caller */
static GLuint shader_glsl_generate_vshader(IWineD3DVertexShaderImpl *This, static GLuint shader_glsl_generate_vshader(IWineD3DVertexShaderImpl *This,
SHADER_BUFFER *buffer, const struct vs_compile_args *args) struct wined3d_shader_buffer *buffer, const struct vs_compile_args *args)
{ {
const struct shader_reg_maps *reg_maps = &This->baseShader.reg_maps; const struct shader_reg_maps *reg_maps = &This->baseShader.reg_maps;
CONST DWORD *function = This->baseShader.function; CONST DWORD *function = This->baseShader.function;
...@@ -3838,7 +3838,7 @@ static GLuint shader_glsl_generate_vshader(IWineD3DVertexShaderImpl *This, ...@@ -3838,7 +3838,7 @@ static GLuint shader_glsl_generate_vshader(IWineD3DVertexShaderImpl *This,
return shader_obj; return shader_obj;
} }
static GLhandleARB find_glsl_pshader(struct SHADER_BUFFER *buffer, IWineD3DPixelShaderImpl *shader, static GLhandleARB find_glsl_pshader(struct wined3d_shader_buffer *buffer, IWineD3DPixelShaderImpl *shader,
const struct ps_compile_args *args, const struct ps_np2fixup_info **np2fixup_info) const struct ps_compile_args *args, const struct ps_np2fixup_info **np2fixup_info)
{ {
UINT i; UINT i;
...@@ -3906,7 +3906,7 @@ static inline BOOL vs_args_equal(const struct vs_compile_args *stored, const str ...@@ -3906,7 +3906,7 @@ static inline BOOL vs_args_equal(const struct vs_compile_args *stored, const str
return stored->fog_src == new->fog_src; return stored->fog_src == new->fog_src;
} }
static GLhandleARB find_glsl_vshader(struct SHADER_BUFFER *buffer, IWineD3DVertexShaderImpl *shader, static GLhandleARB find_glsl_vshader(struct wined3d_shader_buffer *buffer, IWineD3DVertexShaderImpl *shader,
const struct vs_compile_args *args) const struct vs_compile_args *args)
{ {
UINT i; UINT i;
......
...@@ -505,12 +505,14 @@ typedef enum COMPARISON_TYPE ...@@ -505,12 +505,14 @@ typedef enum COMPARISON_TYPE
#define MAX_LABELS 16 #define MAX_LABELS 16
#define SHADER_PGMSIZE 65535 #define SHADER_PGMSIZE 65535
typedef struct SHADER_BUFFER {
char* buffer; struct wined3d_shader_buffer
{
char *buffer;
unsigned int bsize; unsigned int bsize;
unsigned int lineNo; unsigned int lineNo;
BOOL newline; BOOL newline;
} SHADER_BUFFER; };
enum WINED3D_SHADER_INSTRUCTION_HANDLER enum WINED3D_SHADER_INSTRUCTION_HANDLER
{ {
...@@ -659,7 +661,7 @@ struct wined3d_shader_context ...@@ -659,7 +661,7 @@ struct wined3d_shader_context
{ {
IWineD3DBaseShader *shader; IWineD3DBaseShader *shader;
const struct shader_reg_maps *reg_maps; const struct shader_reg_maps *reg_maps;
SHADER_BUFFER *buffer; struct wined3d_shader_buffer *buffer;
void *backend_data; void *backend_data;
}; };
...@@ -2548,12 +2550,9 @@ typedef struct SHADER_PARSE_STATE { ...@@ -2548,12 +2550,9 @@ typedef struct SHADER_PARSE_STATE {
#define PRINTF_ATTR(fmt,args) #define PRINTF_ATTR(fmt,args)
#endif #endif
/* Base Shader utility functions. /* Base Shader utility functions. */
* (may move callers into the same file in the future) */ int shader_addline(struct wined3d_shader_buffer *buffer, const char *fmt, ...) PRINTF_ATTR(2,3);
extern int shader_addline( int shader_vaddline(struct wined3d_shader_buffer *buffer, const char *fmt, va_list args);
SHADER_BUFFER* buffer,
const char* fmt, ...) PRINTF_ATTR(2,3);
int shader_vaddline(SHADER_BUFFER *buffer, const char *fmt, va_list args);
/* Vertex shader utility functions */ /* Vertex shader utility functions */
extern BOOL vshader_get_input( extern BOOL vshader_get_input(
...@@ -2601,15 +2600,15 @@ typedef struct IWineD3DBaseShaderImpl { ...@@ -2601,15 +2600,15 @@ typedef struct IWineD3DBaseShaderImpl {
IWineD3DBaseShaderClass baseShader; IWineD3DBaseShaderClass baseShader;
} IWineD3DBaseShaderImpl; } IWineD3DBaseShaderImpl;
void shader_buffer_clear(struct SHADER_BUFFER *buffer); void shader_buffer_clear(struct wined3d_shader_buffer *buffer);
void shader_buffer_init(struct SHADER_BUFFER *buffer); void shader_buffer_init(struct wined3d_shader_buffer *buffer);
void shader_buffer_free(struct SHADER_BUFFER *buffer); void shader_buffer_free(struct wined3d_shader_buffer *buffer);
void shader_cleanup(IWineD3DBaseShader *iface); void shader_cleanup(IWineD3DBaseShader *iface);
void shader_dump_src_param(const struct wined3d_shader_src_param *param, void shader_dump_src_param(const struct wined3d_shader_src_param *param,
const struct wined3d_shader_version *shader_version); const struct wined3d_shader_version *shader_version);
void shader_dump_dst_param(const struct wined3d_shader_dst_param *param, void shader_dump_dst_param(const struct wined3d_shader_dst_param *param,
const struct wined3d_shader_version *shader_version); const struct wined3d_shader_version *shader_version);
void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER *buffer, void shader_generate_main(IWineD3DBaseShader *iface, struct wined3d_shader_buffer *buffer,
const shader_reg_maps *reg_maps, const DWORD *pFunction, void *backend_ctx); const shader_reg_maps *reg_maps, const DWORD *pFunction, void *backend_ctx);
HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, const struct wined3d_shader_frontend *fe, HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, const struct wined3d_shader_frontend *fe,
struct shader_reg_maps *reg_maps, struct wined3d_shader_attribute *attributes, struct shader_reg_maps *reg_maps, struct wined3d_shader_attribute *attributes,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment