Commit 3d718d64 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Make the "labels" shader_reg_maps member a bitmap.

parent 270f57e7
......@@ -599,7 +599,7 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, const struct wined3
struct wined3d_shader_src_param src, rel_addr;
fe->shader_read_src_param(fe_data, &pToken, &src, &rel_addr);
reg_maps->labels[src.reg.idx] = 1;
reg_maps->labels |= 1 << src.reg.idx;
}
/* Set texture, address, temporary registers */
else
......
......@@ -821,9 +821,9 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont
char prefix = pshader ? 'P' : 'V';
/* Prototype the subroutines */
for (i = 0; i < This->baseShader.limits.label; i++) {
if (reg_maps->labels[i])
shader_addline(buffer, "void subroutine%u();\n", i);
for (i = 0, map = reg_maps->labels; map; map >>= 1, ++i)
{
if (map & 1) shader_addline(buffer, "void subroutine%u();\n", i);
}
/* Declare the constants (aka uniforms) */
......
......@@ -630,8 +630,8 @@ typedef struct shader_reg_maps
struct wined3d_shader_version shader_version;
BYTE texcoord; /* MAX_REG_TEXCRD, 8 */
BYTE address; /* MAX_REG_ADDR, 1 */
WORD labels; /* MAX_LABELS, 16 */
DWORD temporary; /* MAX_REG_TEMP, 32 */
char labels[MAX_LABELS]; /* pixel, vertex */
DWORD *constf; /* pixel, vertex */
DWORD texcoord_mask[MAX_REG_TEXCRD]; /* vertex < 3.0 */
WORD input_registers; /* max(MAX_REG_INPUT, MAX_ATTRIBS), 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