aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_draw_upload.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2017-03-01 23:31:15 -0800
committerKenneth Graunke <[email protected]>2017-03-02 00:30:45 -0800
commit58793e514b6c57924b08d3a9c766ed05e8d9662a (patch)
tree3d2c848c4367cd74e48cef23734c24eb6d613693 /src/mesa/drivers/dri/i965/brw_draw_upload.c
parent92281b2c7f61d6fb8f7cc43eac15bb487f1e9848 (diff)
i965: Replace BRW_SURFACEFORMAT_* with ISL_FORMAT_*.
One less set of enums. Dropped the #defines from brw_defines.h and ran: $ for file in *.cpp *.c *.h; do sed -i \ -e 's/BRW_SURFACEFORMAT_/ISL_FORMAT_/g' \ -e 's/ISL_FORMAT_ASTC_[A-Zxs0-9_]*/\U&/g' $file; \ done Signed-off-by: Kenneth Graunke <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_draw_upload.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_draw_upload.c262
1 files changed, 131 insertions, 131 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index 04d7aa9e9bf..025da5e10db 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -39,186 +39,186 @@
static const GLuint double_types_float[5] = {
0,
- BRW_SURFACEFORMAT_R64_FLOAT,
- BRW_SURFACEFORMAT_R64G64_FLOAT,
- BRW_SURFACEFORMAT_R64G64B64_FLOAT,
- BRW_SURFACEFORMAT_R64G64B64A64_FLOAT
+ ISL_FORMAT_R64_FLOAT,
+ ISL_FORMAT_R64G64_FLOAT,
+ ISL_FORMAT_R64G64B64_FLOAT,
+ ISL_FORMAT_R64G64B64A64_FLOAT
};
static const GLuint double_types_passthru[5] = {
0,
- BRW_SURFACEFORMAT_R64_PASSTHRU,
- BRW_SURFACEFORMAT_R64G64_PASSTHRU,
- BRW_SURFACEFORMAT_R64G64B64_PASSTHRU,
- BRW_SURFACEFORMAT_R64G64B64A64_PASSTHRU
+ ISL_FORMAT_R64_PASSTHRU,
+ ISL_FORMAT_R64G64_PASSTHRU,
+ ISL_FORMAT_R64G64B64_PASSTHRU,
+ ISL_FORMAT_R64G64B64A64_PASSTHRU
};
static const GLuint float_types[5] = {
0,
- BRW_SURFACEFORMAT_R32_FLOAT,
- BRW_SURFACEFORMAT_R32G32_FLOAT,
- BRW_SURFACEFORMAT_R32G32B32_FLOAT,
- BRW_SURFACEFORMAT_R32G32B32A32_FLOAT
+ ISL_FORMAT_R32_FLOAT,
+ ISL_FORMAT_R32G32_FLOAT,
+ ISL_FORMAT_R32G32B32_FLOAT,
+ ISL_FORMAT_R32G32B32A32_FLOAT
};
static const GLuint half_float_types[5] = {
0,
- BRW_SURFACEFORMAT_R16_FLOAT,
- BRW_SURFACEFORMAT_R16G16_FLOAT,
- BRW_SURFACEFORMAT_R16G16B16_FLOAT,
- BRW_SURFACEFORMAT_R16G16B16A16_FLOAT
+ ISL_FORMAT_R16_FLOAT,
+ ISL_FORMAT_R16G16_FLOAT,
+ ISL_FORMAT_R16G16B16_FLOAT,
+ ISL_FORMAT_R16G16B16A16_FLOAT
};
static const GLuint fixed_point_types[5] = {
0,
- BRW_SURFACEFORMAT_R32_SFIXED,
- BRW_SURFACEFORMAT_R32G32_SFIXED,
- BRW_SURFACEFORMAT_R32G32B32_SFIXED,
- BRW_SURFACEFORMAT_R32G32B32A32_SFIXED,
+ ISL_FORMAT_R32_SFIXED,
+ ISL_FORMAT_R32G32_SFIXED,
+ ISL_FORMAT_R32G32B32_SFIXED,
+ ISL_FORMAT_R32G32B32A32_SFIXED,
};
static const GLuint uint_types_direct[5] = {
0,
- BRW_SURFACEFORMAT_R32_UINT,
- BRW_SURFACEFORMAT_R32G32_UINT,
- BRW_SURFACEFORMAT_R32G32B32_UINT,
- BRW_SURFACEFORMAT_R32G32B32A32_UINT
+ ISL_FORMAT_R32_UINT,
+ ISL_FORMAT_R32G32_UINT,
+ ISL_FORMAT_R32G32B32_UINT,
+ ISL_FORMAT_R32G32B32A32_UINT
};
static const GLuint uint_types_norm[5] = {
0,
- BRW_SURFACEFORMAT_R32_UNORM,
- BRW_SURFACEFORMAT_R32G32_UNORM,
- BRW_SURFACEFORMAT_R32G32B32_UNORM,
- BRW_SURFACEFORMAT_R32G32B32A32_UNORM
+ ISL_FORMAT_R32_UNORM,
+ ISL_FORMAT_R32G32_UNORM,
+ ISL_FORMAT_R32G32B32_UNORM,
+ ISL_FORMAT_R32G32B32A32_UNORM
};
static const GLuint uint_types_scale[5] = {
0,
- BRW_SURFACEFORMAT_R32_USCALED,
- BRW_SURFACEFORMAT_R32G32_USCALED,
- BRW_SURFACEFORMAT_R32G32B32_USCALED,
- BRW_SURFACEFORMAT_R32G32B32A32_USCALED
+ ISL_FORMAT_R32_USCALED,
+ ISL_FORMAT_R32G32_USCALED,
+ ISL_FORMAT_R32G32B32_USCALED,
+ ISL_FORMAT_R32G32B32A32_USCALED
};
static const GLuint int_types_direct[5] = {
0,
- BRW_SURFACEFORMAT_R32_SINT,
- BRW_SURFACEFORMAT_R32G32_SINT,
- BRW_SURFACEFORMAT_R32G32B32_SINT,
- BRW_SURFACEFORMAT_R32G32B32A32_SINT
+ ISL_FORMAT_R32_SINT,
+ ISL_FORMAT_R32G32_SINT,
+ ISL_FORMAT_R32G32B32_SINT,
+ ISL_FORMAT_R32G32B32A32_SINT
};
static const GLuint int_types_norm[5] = {
0,
- BRW_SURFACEFORMAT_R32_SNORM,
- BRW_SURFACEFORMAT_R32G32_SNORM,
- BRW_SURFACEFORMAT_R32G32B32_SNORM,
- BRW_SURFACEFORMAT_R32G32B32A32_SNORM
+ ISL_FORMAT_R32_SNORM,
+ ISL_FORMAT_R32G32_SNORM,
+ ISL_FORMAT_R32G32B32_SNORM,
+ ISL_FORMAT_R32G32B32A32_SNORM
};
static const GLuint int_types_scale[5] = {
0,
- BRW_SURFACEFORMAT_R32_SSCALED,
- BRW_SURFACEFORMAT_R32G32_SSCALED,
- BRW_SURFACEFORMAT_R32G32B32_SSCALED,
- BRW_SURFACEFORMAT_R32G32B32A32_SSCALED
+ ISL_FORMAT_R32_SSCALED,
+ ISL_FORMAT_R32G32_SSCALED,
+ ISL_FORMAT_R32G32B32_SSCALED,
+ ISL_FORMAT_R32G32B32A32_SSCALED
};
static const GLuint ushort_types_direct[5] = {
0,
- BRW_SURFACEFORMAT_R16_UINT,
- BRW_SURFACEFORMAT_R16G16_UINT,
- BRW_SURFACEFORMAT_R16G16B16_UINT,
- BRW_SURFACEFORMAT_R16G16B16A16_UINT
+ ISL_FORMAT_R16_UINT,
+ ISL_FORMAT_R16G16_UINT,
+ ISL_FORMAT_R16G16B16_UINT,
+ ISL_FORMAT_R16G16B16A16_UINT
};
static const GLuint ushort_types_norm[5] = {
0,
- BRW_SURFACEFORMAT_R16_UNORM,
- BRW_SURFACEFORMAT_R16G16_UNORM,
- BRW_SURFACEFORMAT_R16G16B16_UNORM,
- BRW_SURFACEFORMAT_R16G16B16A16_UNORM
+ ISL_FORMAT_R16_UNORM,
+ ISL_FORMAT_R16G16_UNORM,
+ ISL_FORMAT_R16G16B16_UNORM,
+ ISL_FORMAT_R16G16B16A16_UNORM
};
static const GLuint ushort_types_scale[5] = {
0,
- BRW_SURFACEFORMAT_R16_USCALED,
- BRW_SURFACEFORMAT_R16G16_USCALED,
- BRW_SURFACEFORMAT_R16G16B16_USCALED,
- BRW_SURFACEFORMAT_R16G16B16A16_USCALED
+ ISL_FORMAT_R16_USCALED,
+ ISL_FORMAT_R16G16_USCALED,
+ ISL_FORMAT_R16G16B16_USCALED,
+ ISL_FORMAT_R16G16B16A16_USCALED
};
static const GLuint short_types_direct[5] = {
0,
- BRW_SURFACEFORMAT_R16_SINT,
- BRW_SURFACEFORMAT_R16G16_SINT,
- BRW_SURFACEFORMAT_R16G16B16_SINT,
- BRW_SURFACEFORMAT_R16G16B16A16_SINT
+ ISL_FORMAT_R16_SINT,
+ ISL_FORMAT_R16G16_SINT,
+ ISL_FORMAT_R16G16B16_SINT,
+ ISL_FORMAT_R16G16B16A16_SINT
};
static const GLuint short_types_norm[5] = {
0,
- BRW_SURFACEFORMAT_R16_SNORM,
- BRW_SURFACEFORMAT_R16G16_SNORM,
- BRW_SURFACEFORMAT_R16G16B16_SNORM,
- BRW_SURFACEFORMAT_R16G16B16A16_SNORM
+ ISL_FORMAT_R16_SNORM,
+ ISL_FORMAT_R16G16_SNORM,
+ ISL_FORMAT_R16G16B16_SNORM,
+ ISL_FORMAT_R16G16B16A16_SNORM
};
static const GLuint short_types_scale[5] = {
0,
- BRW_SURFACEFORMAT_R16_SSCALED,
- BRW_SURFACEFORMAT_R16G16_SSCALED,
- BRW_SURFACEFORMAT_R16G16B16_SSCALED,
- BRW_SURFACEFORMAT_R16G16B16A16_SSCALED
+ ISL_FORMAT_R16_SSCALED,
+ ISL_FORMAT_R16G16_SSCALED,
+ ISL_FORMAT_R16G16B16_SSCALED,
+ ISL_FORMAT_R16G16B16A16_SSCALED
};
static const GLuint ubyte_types_direct[5] = {
0,
- BRW_SURFACEFORMAT_R8_UINT,
- BRW_SURFACEFORMAT_R8G8_UINT,
- BRW_SURFACEFORMAT_R8G8B8_UINT,
- BRW_SURFACEFORMAT_R8G8B8A8_UINT
+ ISL_FORMAT_R8_UINT,
+ ISL_FORMAT_R8G8_UINT,
+ ISL_FORMAT_R8G8B8_UINT,
+ ISL_FORMAT_R8G8B8A8_UINT
};
static const GLuint ubyte_types_norm[5] = {
0,
- BRW_SURFACEFORMAT_R8_UNORM,
- BRW_SURFACEFORMAT_R8G8_UNORM,
- BRW_SURFACEFORMAT_R8G8B8_UNORM,
- BRW_SURFACEFORMAT_R8G8B8A8_UNORM
+ ISL_FORMAT_R8_UNORM,
+ ISL_FORMAT_R8G8_UNORM,
+ ISL_FORMAT_R8G8B8_UNORM,
+ ISL_FORMAT_R8G8B8A8_UNORM
};
static const GLuint ubyte_types_scale[5] = {
0,
- BRW_SURFACEFORMAT_R8_USCALED,
- BRW_SURFACEFORMAT_R8G8_USCALED,
- BRW_SURFACEFORMAT_R8G8B8_USCALED,
- BRW_SURFACEFORMAT_R8G8B8A8_USCALED
+ ISL_FORMAT_R8_USCALED,
+ ISL_FORMAT_R8G8_USCALED,
+ ISL_FORMAT_R8G8B8_USCALED,
+ ISL_FORMAT_R8G8B8A8_USCALED
};
static const GLuint byte_types_direct[5] = {
0,
- BRW_SURFACEFORMAT_R8_SINT,
- BRW_SURFACEFORMAT_R8G8_SINT,
- BRW_SURFACEFORMAT_R8G8B8_SINT,
- BRW_SURFACEFORMAT_R8G8B8A8_SINT
+ ISL_FORMAT_R8_SINT,
+ ISL_FORMAT_R8G8_SINT,
+ ISL_FORMAT_R8G8B8_SINT,
+ ISL_FORMAT_R8G8B8A8_SINT
};
static const GLuint byte_types_norm[5] = {
0,
- BRW_SURFACEFORMAT_R8_SNORM,
- BRW_SURFACEFORMAT_R8G8_SNORM,
- BRW_SURFACEFORMAT_R8G8B8_SNORM,
- BRW_SURFACEFORMAT_R8G8B8A8_SNORM
+ ISL_FORMAT_R8_SNORM,
+ ISL_FORMAT_R8G8_SNORM,
+ ISL_FORMAT_R8G8B8_SNORM,
+ ISL_FORMAT_R8G8B8A8_SNORM
};
static const GLuint byte_types_scale[5] = {
0,
- BRW_SURFACEFORMAT_R8_SSCALED,
- BRW_SURFACEFORMAT_R8G8_SSCALED,
- BRW_SURFACEFORMAT_R8G8B8_SSCALED,
- BRW_SURFACEFORMAT_R8G8B8A8_SSCALED
+ ISL_FORMAT_R8_SSCALED,
+ ISL_FORMAT_R8G8_SSCALED,
+ ISL_FORMAT_R8G8B8_SSCALED,
+ ISL_FORMAT_R8G8B8A8_SSCALED
};
static GLuint
@@ -246,10 +246,10 @@ static bool
is_passthru_format(uint32_t format)
{
switch (format) {
- case BRW_SURFACEFORMAT_R64_PASSTHRU:
- case BRW_SURFACEFORMAT_R64G64_PASSTHRU:
- case BRW_SURFACEFORMAT_R64G64B64_PASSTHRU:
- case BRW_SURFACEFORMAT_R64G64B64A64_PASSTHRU:
+ case ISL_FORMAT_R64_PASSTHRU:
+ case ISL_FORMAT_R64G64_PASSTHRU:
+ case ISL_FORMAT_R64G64B64_PASSTHRU:
+ case ISL_FORMAT_R64G64B64A64_PASSTHRU:
return true;
default:
return false;
@@ -263,11 +263,11 @@ uploads_needed(uint32_t format)
return 1;
switch (format) {
- case BRW_SURFACEFORMAT_R64_PASSTHRU:
- case BRW_SURFACEFORMAT_R64G64_PASSTHRU:
+ case ISL_FORMAT_R64_PASSTHRU:
+ case ISL_FORMAT_R64G64_PASSTHRU:
return 1;
- case BRW_SURFACEFORMAT_R64G64B64_PASSTHRU:
- case BRW_SURFACEFORMAT_R64G64B64A64_PASSTHRU:
+ case ISL_FORMAT_R64G64B64_PASSTHRU:
+ case ISL_FORMAT_R64G64B64A64_PASSTHRU:
return 2;
default:
unreachable("not reached");
@@ -282,9 +282,9 @@ static int
upload_format_size(uint32_t upload_format)
{
switch (upload_format) {
- case BRW_SURFACEFORMAT_R32G32_FLOAT:
+ case ISL_FORMAT_R32G32_FLOAT:
return 2;
- case BRW_SURFACEFORMAT_R32G32B32A32_FLOAT:
+ case ISL_FORMAT_R32G32B32A32_FLOAT:
return 4;
default:
unreachable("not reached");
@@ -308,15 +308,15 @@ downsize_format_if_needed(uint32_t format,
return format;
switch (format) {
- case BRW_SURFACEFORMAT_R64_PASSTHRU:
- return BRW_SURFACEFORMAT_R32G32_FLOAT;
- case BRW_SURFACEFORMAT_R64G64_PASSTHRU:
- return BRW_SURFACEFORMAT_R32G32B32A32_FLOAT;
- case BRW_SURFACEFORMAT_R64G64B64_PASSTHRU:
- return !upload ? BRW_SURFACEFORMAT_R32G32B32A32_FLOAT
- : BRW_SURFACEFORMAT_R32G32_FLOAT;
- case BRW_SURFACEFORMAT_R64G64B64A64_PASSTHRU:
- return BRW_SURFACEFORMAT_R32G32B32A32_FLOAT;
+ case ISL_FORMAT_R64_PASSTHRU:
+ return ISL_FORMAT_R32G32_FLOAT;
+ case ISL_FORMAT_R64G64_PASSTHRU:
+ return ISL_FORMAT_R32G32B32A32_FLOAT;
+ case ISL_FORMAT_R64G64B64_PASSTHRU:
+ return !upload ? ISL_FORMAT_R32G32B32A32_FLOAT
+ : ISL_FORMAT_R32G32_FLOAT;
+ case ISL_FORMAT_R64G64B64A64_PASSTHRU:
+ return ISL_FORMAT_R32G32B32A32_FLOAT;
default:
unreachable("not reached");
}
@@ -368,7 +368,7 @@ brw_get_vertex_surface_type(struct brw_context *brw,
default: unreachable("not reached");
}
} else if (glarray->Type == GL_UNSIGNED_INT_10F_11F_11F_REV) {
- return BRW_SURFACEFORMAT_R11G11B10_FLOAT;
+ return ISL_FORMAT_R11G11B10_FLOAT;
} else if (glarray->Normalized) {
switch (glarray->Type) {
case GL_DOUBLE: return double_types(brw, size, glarray->Doubles);
@@ -388,7 +388,7 @@ brw_get_vertex_surface_type(struct brw_context *brw,
if (glarray->Format == GL_BGRA) {
/* See GL_EXT_vertex_array_bgra */
assert(size == 4);
- return BRW_SURFACEFORMAT_B8G8R8A8_UNORM;
+ return ISL_FORMAT_B8G8R8A8_UNORM;
}
else {
return ubyte_types_norm[size];
@@ -410,18 +410,18 @@ brw_get_vertex_surface_type(struct brw_context *brw,
assert(size == 4);
if (brw->gen >= 8 || brw->is_haswell) {
return glarray->Format == GL_BGRA
- ? BRW_SURFACEFORMAT_B10G10R10A2_SNORM
- : BRW_SURFACEFORMAT_R10G10B10A2_SNORM;
+ ? ISL_FORMAT_B10G10R10A2_SNORM
+ : ISL_FORMAT_R10G10B10A2_SNORM;
}
- return BRW_SURFACEFORMAT_R10G10B10A2_UINT;
+ return ISL_FORMAT_R10G10B10A2_UINT;
case GL_UNSIGNED_INT_2_10_10_10_REV:
assert(size == 4);
if (brw->gen >= 8 || brw->is_haswell) {
return glarray->Format == GL_BGRA
- ? BRW_SURFACEFORMAT_B10G10R10A2_UNORM
- : BRW_SURFACEFORMAT_R10G10B10A2_UNORM;
+ ? ISL_FORMAT_B10G10R10A2_UNORM
+ : ISL_FORMAT_R10G10B10A2_UNORM;
}
- return BRW_SURFACEFORMAT_R10G10B10A2_UINT;
+ return ISL_FORMAT_R10G10B10A2_UINT;
default: unreachable("not reached");
}
}
@@ -435,18 +435,18 @@ brw_get_vertex_surface_type(struct brw_context *brw,
assert(size == 4);
if (brw->gen >= 8 || brw->is_haswell) {
return glarray->Format == GL_BGRA
- ? BRW_SURFACEFORMAT_B10G10R10A2_SSCALED
- : BRW_SURFACEFORMAT_R10G10B10A2_SSCALED;
+ ? ISL_FORMAT_B10G10R10A2_SSCALED
+ : ISL_FORMAT_R10G10B10A2_SSCALED;
}
- return BRW_SURFACEFORMAT_R10G10B10A2_UINT;
+ return ISL_FORMAT_R10G10B10A2_UINT;
} else if (glarray->Type == GL_UNSIGNED_INT_2_10_10_10_REV) {
assert(size == 4);
if (brw->gen >= 8 || brw->is_haswell) {
return glarray->Format == GL_BGRA
- ? BRW_SURFACEFORMAT_B10G10R10A2_USCALED
- : BRW_SURFACEFORMAT_R10G10B10A2_USCALED;
+ ? ISL_FORMAT_B10G10R10A2_USCALED
+ : ISL_FORMAT_R10G10B10A2_USCALED;
}
- return BRW_SURFACEFORMAT_R10G10B10A2_UINT;
+ return ISL_FORMAT_R10G10B10A2_UINT;
}
assert(glarray->Format == GL_RGBA); /* sanity check */
switch (glarray->Type) {
@@ -910,12 +910,12 @@ brw_emit_vertices(struct brw_context *brw)
if (brw->gen >= 6) {
OUT_BATCH((0 << GEN6_VE0_INDEX_SHIFT) |
GEN6_VE0_VALID |
- (BRW_SURFACEFORMAT_R32G32B32A32_FLOAT << BRW_VE0_FORMAT_SHIFT) |
+ (ISL_FORMAT_R32G32B32A32_FLOAT << BRW_VE0_FORMAT_SHIFT) |
(0 << BRW_VE0_SRC_OFFSET_SHIFT));
} else {
OUT_BATCH((0 << BRW_VE0_INDEX_SHIFT) |
BRW_VE0_VALID |
- (BRW_SURFACEFORMAT_R32G32B32A32_FLOAT << BRW_VE0_FORMAT_SHIFT) |
+ (ISL_FORMAT_R32G32B32A32_FLOAT << BRW_VE0_FORMAT_SHIFT) |
(0 << BRW_VE0_SRC_OFFSET_SHIFT));
}
OUT_BATCH((BRW_VE1_COMPONENT_STORE_0 << BRW_VE1_COMPONENT_0_SHIFT) |
@@ -1091,11 +1091,11 @@ brw_emit_vertices(struct brw_context *brw)
if (brw->gen >= 6) {
dw0 |= GEN6_VE0_VALID |
brw->vb.nr_buffers << GEN6_VE0_INDEX_SHIFT |
- BRW_SURFACEFORMAT_R32G32_UINT << BRW_VE0_FORMAT_SHIFT;
+ ISL_FORMAT_R32G32_UINT << BRW_VE0_FORMAT_SHIFT;
} else {
dw0 |= BRW_VE0_VALID |
brw->vb.nr_buffers << BRW_VE0_INDEX_SHIFT |
- BRW_SURFACEFORMAT_R32G32_UINT << BRW_VE0_FORMAT_SHIFT;
+ ISL_FORMAT_R32G32_UINT << BRW_VE0_FORMAT_SHIFT;
dw1 |= (i * 4) << BRW_VE1_DST_OFFSET_SHIFT;
}
@@ -1118,11 +1118,11 @@ brw_emit_vertices(struct brw_context *brw)
if (brw->gen >= 6) {
dw0 |= GEN6_VE0_VALID |
((brw->vb.nr_buffers + 1) << GEN6_VE0_INDEX_SHIFT) |
- (BRW_SURFACEFORMAT_R32_UINT << BRW_VE0_FORMAT_SHIFT);
+ (ISL_FORMAT_R32_UINT << BRW_VE0_FORMAT_SHIFT);
} else {
dw0 |= BRW_VE0_VALID |
((brw->vb.nr_buffers + 1) << BRW_VE0_INDEX_SHIFT) |
- (BRW_SURFACEFORMAT_R32_UINT << BRW_VE0_FORMAT_SHIFT);
+ (ISL_FORMAT_R32_UINT << BRW_VE0_FORMAT_SHIFT);
dw1 |= (i * 4) << BRW_VE1_DST_OFFSET_SHIFT;
}