Commit db164a99 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Rename shader_reg_maps to wined3d_shader_reg_maps.

For consistency with other shader translation structures.
parent ac2afd08
......@@ -317,7 +317,7 @@ struct shader_arb_priv
/* GL locking for state handlers is done by the caller. */
static BOOL need_rel_addr_const(const struct arb_vshader_private *shader_data,
const struct shader_reg_maps *reg_maps, const struct wined3d_gl_info *gl_info)
const struct wined3d_shader_reg_maps *reg_maps, const struct wined3d_gl_info *gl_info)
{
if (shader_data->rel_offset) return TRUE;
if (!reg_maps->usesmova) return FALSE;
......@@ -332,7 +332,7 @@ static inline BOOL use_nv_clip(const struct wined3d_gl_info *gl_info)
}
static BOOL need_helper_const(const struct arb_vshader_private *shader_data,
const struct shader_reg_maps *reg_maps, const struct wined3d_gl_info *gl_info)
const struct wined3d_shader_reg_maps *reg_maps, const struct wined3d_gl_info *gl_info)
{
if (need_rel_addr_const(shader_data, reg_maps, gl_info)) return TRUE;
if (!gl_info->supported[NV_VERTEX_PROGRAM]) return TRUE; /* Need to init colors. */
......@@ -345,7 +345,7 @@ static BOOL need_helper_const(const struct arb_vshader_private *shader_data,
}
static unsigned int reserved_vs_const(const struct arb_vshader_private *shader_data,
const struct shader_reg_maps *reg_maps, const struct wined3d_gl_info *gl_info)
const struct wined3d_shader_reg_maps *reg_maps, const struct wined3d_gl_info *gl_info)
{
unsigned int ret = 1;
/* We use one PARAM for the pos fixup, and in some cases one to load
......@@ -694,8 +694,9 @@ static DWORD *local_const_mapping(IWineD3DBaseShaderImpl *This)
}
/* 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,
struct wined3d_shader_buffer *buffer, const struct wined3d_gl_info *gl_info, DWORD *lconst_map,
static DWORD shader_generate_arb_declarations(IWineD3DBaseShader *iface,
const struct wined3d_shader_reg_maps *reg_maps, struct wined3d_shader_buffer *buffer,
const struct wined3d_gl_info *gl_info, DWORD *lconst_map,
DWORD *num_clipplanes, struct shader_arb_ctx_priv *ctx)
{
IWineD3DBaseShaderImpl* This = (IWineD3DBaseShaderImpl*) iface;
......@@ -931,7 +932,7 @@ static void shader_arb_get_register_name(const struct wined3d_shader_instruction
/* oPos, oFog and oPts in D3D */
static const char * const rastout_reg_names[] = {"TMP_OUT", "result.fogcoord", "result.pointsize"};
IWineD3DBaseShaderImpl *This = (IWineD3DBaseShaderImpl *)ins->ctx->shader;
const struct shader_reg_maps *reg_maps = ins->ctx->reg_maps;
const struct wined3d_shader_reg_maps *reg_maps = ins->ctx->reg_maps;
BOOL pshader = shader_is_pshader_version(reg_maps->shader_version.type);
struct shader_arb_ctx_priv *ctx = ins->ctx->backend_data;
......@@ -1743,7 +1744,7 @@ static void shader_hw_nop(const struct wined3d_shader_instruction *ins)
static void shader_hw_mov(const struct wined3d_shader_instruction *ins)
{
IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)ins->ctx->shader;
const struct shader_reg_maps *reg_maps = ins->ctx->reg_maps;
const struct wined3d_shader_reg_maps *reg_maps = ins->ctx->reg_maps;
BOOL pshader = shader_is_pshader_version(reg_maps->shader_version.type);
struct shader_arb_ctx_priv *ctx = ins->ctx->backend_data;
const char *zero = arb_get_helper_value(reg_maps->shader_version.type, ARB_ZERO);
......@@ -3099,7 +3100,7 @@ static void shader_hw_label(const struct wined3d_shader_instruction *ins)
static void vshader_add_footer(struct shader_arb_ctx_priv *priv_ctx,
const struct arb_vshader_private *shader_data, const struct arb_vs_compile_args *args,
const struct shader_reg_maps *reg_maps, const struct wined3d_gl_info *gl_info,
const struct wined3d_shader_reg_maps *reg_maps, const struct wined3d_gl_info *gl_info,
struct wined3d_shader_buffer *buffer)
{
unsigned int i;
......@@ -3490,7 +3491,7 @@ static void init_ps_input(const IWineD3DPixelShaderImpl *This, const struct arb_
static GLuint shader_arb_generate_pshader(IWineD3DPixelShaderImpl *This, struct wined3d_shader_buffer *buffer,
const struct arb_ps_compile_args *args, struct arb_ps_compiled_shader *compiled)
{
const shader_reg_maps* reg_maps = &This->baseShader.reg_maps;
const struct wined3d_shader_reg_maps *reg_maps = &This->baseShader.reg_maps;
CONST DWORD *function = This->baseShader.function;
const struct wined3d_gl_info *gl_info = &((IWineD3DDeviceImpl *)This->baseShader.device)->adapter->gl_info;
const local_constant *lconst;
......@@ -4070,7 +4071,7 @@ static GLuint shader_arb_generate_vshader(IWineD3DVertexShaderImpl *This, struct
const struct arb_vs_compile_args *args, struct arb_vs_compiled_shader *compiled)
{
const struct arb_vshader_private *shader_data = This->baseShader.backend_data;
const shader_reg_maps *reg_maps = &This->baseShader.reg_maps;
const struct wined3d_shader_reg_maps *reg_maps = &This->baseShader.reg_maps;
CONST DWORD *function = This->baseShader.function;
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)This->baseShader.device;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
......@@ -4337,7 +4338,7 @@ static struct arb_vs_compiled_shader *find_arb_vshader(IWineD3DVertexShaderImpl
if (!shader->baseShader.backend_data)
{
const struct shader_reg_maps *reg_maps = &shader->baseShader.reg_maps;
const struct wined3d_shader_reg_maps *reg_maps = &shader->baseShader.reg_maps;
shader->baseShader.backend_data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*shader_data));
shader_data = shader->baseShader.backend_data;
......@@ -5058,7 +5059,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL
static inline BOOL get_bool_const(const struct wined3d_shader_instruction *ins, IWineD3DBaseShaderImpl *This, DWORD idx)
{
const struct shader_reg_maps *reg_maps = ins->ctx->reg_maps;
const struct wined3d_shader_reg_maps *reg_maps = ins->ctx->reg_maps;
BOOL vshader = shader_is_vshader_version(reg_maps->shader_version.type);
WORD bools = 0;
WORD flag = (1 << idx);
......@@ -5089,7 +5090,7 @@ static inline BOOL get_bool_const(const struct wined3d_shader_instruction *ins,
static void get_loop_control_const(const struct wined3d_shader_instruction *ins,
IWineD3DBaseShaderImpl *This, UINT idx, struct wined3d_shader_loop_control *loop_control)
{
const struct shader_reg_maps *reg_maps = ins->ctx->reg_maps;
const struct wined3d_shader_reg_maps *reg_maps = ins->ctx->reg_maps;
struct shader_arb_ctx_priv *priv = ins->ctx->backend_data;
/* Integer constants can either be a local constant, or they can be stored in the shader
......
......@@ -907,7 +907,7 @@ static unsigned int vec4_varyings(DWORD shader_major, const struct wined3d_gl_in
/** Generate the variable & register declarations for the GLSL output target */
static void shader_generate_glsl_declarations(const struct wined3d_context *context,
struct wined3d_shader_buffer *buffer, IWineD3DBaseShader *iface,
const shader_reg_maps *reg_maps, struct shader_glsl_ctx_priv *ctx_priv)
const struct wined3d_shader_reg_maps *reg_maps, struct shader_glsl_ctx_priv *ctx_priv)
{
IWineD3DBaseShaderImpl* This = (IWineD3DBaseShaderImpl*) iface;
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) This->baseShader.device;
......@@ -1304,7 +1304,7 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register *
static const char * const hwrastout_reg_names[] = {"OUT[10]", "OUT[11].x", "OUT[11].y"};
IWineD3DBaseShaderImpl *This = (IWineD3DBaseShaderImpl *)ins->ctx->shader;
const struct shader_reg_maps *reg_maps = ins->ctx->reg_maps;
const struct wined3d_shader_reg_maps *reg_maps = ins->ctx->reg_maps;
const struct wined3d_gl_info *gl_info = ins->ctx->gl_info;
char pshader = shader_is_pshader_version(reg_maps->shader_version.type);
......@@ -3631,7 +3631,7 @@ static void shader_glsl_dp2add(const struct wined3d_shader_instruction *ins)
}
static void shader_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 wined3d_shader_reg_maps *reg_maps,
enum vertexprocessing_mode vertexprocessing)
{
unsigned int i;
......@@ -3733,9 +3733,12 @@ static void delete_glsl_program_entry(struct shader_glsl_priv *priv, const struc
HeapFree(GetProcessHeap(), 0, entry);
}
static void handle_ps3_input(struct wined3d_shader_buffer *buffer, const struct 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 *output_signature, const struct shader_reg_maps *reg_maps_out)
static void handle_ps3_input(struct wined3d_shader_buffer *buffer,
const struct wined3d_gl_info *gl_info, const DWORD *map,
const struct wined3d_shader_signature_element *input_signature,
const struct wined3d_shader_reg_maps *reg_maps_in,
const struct wined3d_shader_signature_element *output_signature,
const struct wined3d_shader_reg_maps *reg_maps_out)
{
unsigned int i, j;
const char *semantic_name_in;
......@@ -3957,7 +3960,7 @@ static GLuint shader_glsl_generate_pshader(const struct wined3d_context *context
struct wined3d_shader_buffer *buffer, IWineD3DPixelShaderImpl *This,
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 wined3d_shader_reg_maps *reg_maps = &This->baseShader.reg_maps;
const struct wined3d_gl_info *gl_info = context->gl_info;
CONST DWORD *function = This->baseShader.function;
struct shader_glsl_ctx_priv priv_ctx;
......@@ -4061,7 +4064,7 @@ static GLuint shader_glsl_generate_vshader(const struct wined3d_context *context
struct wined3d_shader_buffer *buffer, IWineD3DVertexShaderImpl *This,
const struct vs_compile_args *args)
{
const struct shader_reg_maps *reg_maps = &This->baseShader.reg_maps;
const struct wined3d_shader_reg_maps *reg_maps = &This->baseShader.reg_maps;
const struct wined3d_gl_info *gl_info = context->gl_info;
CONST DWORD *function = This->baseShader.function;
struct shader_glsl_ctx_priv priv_ctx;
......
......@@ -348,7 +348,7 @@ static inline void set_bitmap_bit(DWORD *bitmap, DWORD bit)
bitmap[idx] |= (1 << shift);
}
static void shader_record_register_usage(IWineD3DBaseShaderImpl *shader, struct shader_reg_maps *reg_maps,
static void shader_record_register_usage(IWineD3DBaseShaderImpl *shader, struct wined3d_shader_reg_maps *reg_maps,
const struct wined3d_shader_register *reg, enum wined3d_shader_type shader_type)
{
switch (reg->type)
......@@ -449,7 +449,7 @@ static unsigned int get_instr_extra_regcount(enum WINED3D_SHADER_INSTRUCTION_HAN
/* Note that this does not count the loop register as an address register. */
static HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, const struct wined3d_shader_frontend *fe,
struct shader_reg_maps *reg_maps, struct wined3d_shader_signature_element *input_signature,
struct wined3d_shader_reg_maps *reg_maps, struct wined3d_shader_signature_element *input_signature,
struct wined3d_shader_signature_element *output_signature, const DWORD *byte_code, DWORD constf_size)
{
IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)iface;
......@@ -830,7 +830,7 @@ static HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, const struct
return WINED3D_OK;
}
unsigned int shader_find_free_input_register(const struct shader_reg_maps *reg_maps, unsigned int max)
unsigned int shader_find_free_input_register(const struct wined3d_shader_reg_maps *reg_maps, unsigned int max)
{
DWORD map = 1 << max;
map |= map - 1;
......@@ -1164,7 +1164,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.
* NOTE: A description of how to parse tokens can be found on MSDN. */
void shader_generate_main(IWineD3DBaseShader *iface, struct wined3d_shader_buffer *buffer,
const shader_reg_maps *reg_maps, const DWORD *byte_code, void *backend_ctx)
const struct wined3d_shader_reg_maps *reg_maps, const DWORD *byte_code, void *backend_ctx)
{
IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl *)iface;
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)shader->baseShader.device;
......@@ -1579,7 +1579,7 @@ static HRESULT shader_get_function(IWineD3DBaseShaderImpl *shader, void *data, U
static HRESULT shader_set_function(IWineD3DBaseShaderImpl *shader, const DWORD *byte_code,
const struct wined3d_shader_signature *output_signature, DWORD float_const_count)
{
struct shader_reg_maps *reg_maps = &shader->baseShader.reg_maps;
struct wined3d_shader_reg_maps *reg_maps = &shader->baseShader.reg_maps;
const struct wined3d_shader_frontend *fe;
HRESULT hr;
......@@ -1845,7 +1845,7 @@ HRESULT vertexshader_init(IWineD3DVertexShaderImpl *shader, IWineD3DDeviceImpl *
const DWORD *byte_code, const struct wined3d_shader_signature *output_signature,
void *parent, const struct wined3d_parent_ops *parent_ops)
{
struct shader_reg_maps *reg_maps = &shader->baseShader.reg_maps;
struct wined3d_shader_reg_maps *reg_maps = &shader->baseShader.reg_maps;
unsigned int i;
HRESULT hr;
WORD map;
......@@ -2317,7 +2317,7 @@ HRESULT pixelshader_init(IWineD3DPixelShaderImpl *shader, IWineD3DDeviceImpl *de
return WINED3D_OK;
}
void pixelshader_update_samplers(struct shader_reg_maps *reg_maps, IWineD3DBaseTexture * const *textures)
void pixelshader_update_samplers(struct wined3d_shader_reg_maps *reg_maps, IWineD3DBaseTexture * const *textures)
{
WINED3DSAMPLER_TEXTURE_TYPE *sampler_type = reg_maps->sampler_type;
unsigned int i;
......
......@@ -530,7 +530,7 @@ struct wined3d_shader_version
#define WINED3D_SHADER_VERSION(major, minor) (((major) << 8) | (minor))
typedef struct shader_reg_maps
struct wined3d_shader_reg_maps
{
struct wined3d_shader_version shader_version;
BYTE texcoord; /* MAX_REG_TEXCRD, 8 */
......@@ -569,7 +569,7 @@ typedef struct shader_reg_maps
unsigned loop_depth;
unsigned highest_render_target;
UINT min_rel_offset, max_rel_offset;
} shader_reg_maps;
};
/* Keeps track of details for TEX_M#x# instructions which need to maintain
* state information between multiple instructions. */
......@@ -589,7 +589,7 @@ struct wined3d_shader_context
{
IWineD3DBaseShader *shader;
const struct wined3d_gl_info *gl_info;
const struct shader_reg_maps *reg_maps;
const struct wined3d_shader_reg_maps *reg_maps;
struct wined3d_shader_buffer *buffer;
struct wined3d_shader_tex_mx *tex_mx;
struct wined3d_shader_loop_state *loop_state;
......@@ -2754,7 +2754,7 @@ typedef struct IWineD3DBaseShaderClass
struct list constantsB;
struct list constantsF;
struct list constantsI;
shader_reg_maps reg_maps;
struct wined3d_shader_reg_maps reg_maps;
struct wined3d_shader_signature_element input_signature[max(MAX_ATTRIBS, MAX_REG_INPUT)];
struct wined3d_shader_signature_element output_signature[MAX_REG_OUTPUT];
......@@ -2780,9 +2780,10 @@ void shader_dump_src_param(const struct wined3d_shader_src_param *param,
const struct wined3d_shader_version *shader_version) DECLSPEC_HIDDEN;
void shader_dump_dst_param(const struct wined3d_shader_dst_param *param,
const struct wined3d_shader_version *shader_version) DECLSPEC_HIDDEN;
unsigned int shader_find_free_input_register(const struct shader_reg_maps *reg_maps, unsigned int max) DECLSPEC_HIDDEN;
unsigned int shader_find_free_input_register(const struct wined3d_shader_reg_maps *reg_maps,
unsigned int max) DECLSPEC_HIDDEN;
void shader_generate_main(IWineD3DBaseShader *iface, struct wined3d_shader_buffer *buffer,
const shader_reg_maps *reg_maps, const DWORD *pFunction, void *backend_ctx) DECLSPEC_HIDDEN;
const struct wined3d_shader_reg_maps *reg_maps, const DWORD *pFunction, void *backend_ctx) DECLSPEC_HIDDEN;
BOOL shader_match_semantic(const char *semantic_name, WINED3DDECLUSAGE usage) DECLSPEC_HIDDEN;
static inline BOOL shader_is_pshader_version(enum wined3d_shader_type type)
......@@ -2930,7 +2931,7 @@ typedef struct IWineD3DPixelShaderImpl {
HRESULT pixelshader_init(IWineD3DPixelShaderImpl *shader, IWineD3DDeviceImpl *device,
const DWORD *byte_code, const struct wined3d_shader_signature *output_signature,
void *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
void pixelshader_update_samplers(struct shader_reg_maps *reg_maps,
void pixelshader_update_samplers(struct wined3d_shader_reg_maps *reg_maps,
IWineD3DBaseTexture * const *textures) DECLSPEC_HIDDEN;
void find_ps_compile_args(const struct wined3d_state *state,
IWineD3DPixelShaderImpl *shader, struct ps_compile_args *args) DECLSPEC_HIDDEN;
......
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