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

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

View File

@ -664,9 +664,9 @@ static DWORD shader_generate_arb_declarations(IWineD3DBaseShader *iface, const s
if (map & 1) shader_addline(buffer, "TEMP R%u;\n", i);
}
for (i = 0; i < This->baseShader.limits.address; i++) {
if (reg_maps->address[i])
shader_addline(buffer, "ADDRESS A%d;\n", i);
for (i = 0, map = reg_maps->address; map; map >>= 1, ++i)
{
if (map & 1) shader_addline(buffer, "ADDRESS A%u;\n", i);
}
if (pshader && reg_maps->shader_version.major == 1 && reg_maps->shader_version.minor <= 3)

View File

@ -258,7 +258,7 @@ static void shader_record_register_usage(IWineD3DBaseShaderImpl *This, struct sh
{
case WINED3DSPR_TEXTURE: /* WINED3DSPR_ADDR */
if (shader_type == WINED3D_SHADER_TYPE_PIXEL) reg_maps->texcoord |= 1 << reg->idx;
else reg_maps->address[reg->idx] = 1;
else reg_maps->address |= 1 << reg->idx;
break;
case WINED3DSPR_TEMP:

View File

@ -1004,9 +1004,9 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont
}
/* Declare address variables */
for (i = 0; i < This->baseShader.limits.address; i++) {
if (reg_maps->address[i])
shader_addline(buffer, "ivec4 A%d;\n", i);
for (i = 0, map = reg_maps->address; map; map >>= 1, ++i)
{
if (map & 1) shader_addline(buffer, "ivec4 A%u;\n", i);
}
/* Declare texture coordinate temporaries and initialize them */

View File

@ -629,8 +629,8 @@ typedef struct shader_reg_maps
{
struct wined3d_shader_version shader_version;
BYTE texcoord; /* MAX_REG_TEXCRD, 8 */
BYTE address; /* MAX_REG_ADDR, 1 */
DWORD temporary; /* MAX_REG_TEMP, 32 */
char address[MAX_REG_ADDR]; /* vertex */
char labels[MAX_LABELS]; /* pixel, vertex */
DWORD *constf; /* pixel, vertex */
DWORD texcoord_mask[MAX_REG_TEXCRD]; /* vertex < 3.0 */