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

This commit is contained in:
Henri Verbeet 2009-08-12 09:44:24 +02:00 committed by Alexandre Julliard
parent 270f57e755
commit 3d718d6414
3 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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) */

View File

@ -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 */