Commit 664b17b9 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Make "packed_input" a bitmap.

parent 7ba802ac
......@@ -411,7 +411,7 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, const struct wined3
* Pshader: mark 3.0 input registers used, save token */
case WINED3DSPR_INPUT:
if (!pshader) reg_maps->attributes[semantic.reg.reg.idx] = 1;
else reg_maps->packed_input[semantic.reg.reg.idx] = 1;
else reg_maps->input_registers |= 1 << semantic.reg.reg.idx;
semantics_in[semantic.reg.reg.idx] = semantic;
break;
......
......@@ -3175,14 +3175,15 @@ static void pshader_glsl_input_pack(IWineD3DPixelShader *iface, SHADER_BUFFER *b
{
unsigned int i;
IWineD3DPixelShaderImpl *This = (IWineD3DPixelShaderImpl *)iface;
WORD map = reg_maps->input_registers;
for (i = 0; i < MAX_REG_INPUT; ++i)
for (i = 0; map; map >>= 1, ++i)
{
DWORD usage, usage_idx;
char reg_mask[6];
/* Unused */
if (!reg_maps->packed_input[i]) continue;
if (!(map & 1)) continue;
usage = semantics_in[i].usage;
usage_idx = semantics_in[i].usage_idx;
......@@ -3280,6 +3281,7 @@ static void handle_ps3_input(SHADER_BUFFER *buffer, const WineD3D_GL_Info *gl_in
DWORD in_count = vec4_varyings(3, gl_info);
char reg_mask[6], reg_mask_out[6];
char destination[50];
WORD input_map;
set = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*set) * (in_count + 2));
......@@ -3289,8 +3291,10 @@ static void handle_ps3_input(SHADER_BUFFER *buffer, const WineD3D_GL_Info *gl_in
shader_addline(buffer, "vec4 front_secondary_color = gl_FrontSecondaryColor;\n");
}
for(i = 0; i < MAX_REG_INPUT; i++) {
if (!reg_maps_in->packed_input[i]) continue;
input_map = reg_maps_in->input_registers;
for (i = 0; input_map; input_map >>= 1, ++i)
{
if (!(input_map & 1)) continue;
in_idx = map[i];
if (in_idx >= (in_count + 2)) {
......
......@@ -621,12 +621,12 @@ typedef struct shader_reg_maps
char texcoord[MAX_REG_TEXCRD]; /* pixel < 3.0 */
char temporary[MAX_REG_TEMP]; /* pixel, vertex */
char address[MAX_REG_ADDR]; /* vertex */
char packed_input[MAX_REG_INPUT]; /* pshader >= 3.0 */
char packed_output[MAX_REG_OUTPUT]; /* vertex >= 3.0 */
char attributes[MAX_ATTRIBS]; /* vertex */
char labels[MAX_LABELS]; /* pixel, vertex */
DWORD *constf; /* pixel, vertex */
DWORD texcoord_mask[MAX_REG_TEXCRD]; /* vertex < 3.0 */
WORD input_registers; /* MAX_REG_INPUT, 12 */
WORD integer_constants; /* MAX_CONST_I, 16 */
WORD boolean_constants; /* MAX_CONST_B, 16 */
......
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