summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndres Gomez <[email protected]>2018-02-01 17:15:14 +0200
committerAndres Gomez <[email protected]>2018-02-02 16:32:30 +0200
commit4761a8fea604b11e31c4e044ffc6d3d0b068a621 (patch)
tree851bbf670e71caa1f2234f227f760d935b855681 /src
parent51d36f5e02d7083e52b5617bf44de0105c611db4 (diff)
i965: check if upload is 0 explicitely, when downsizing a format
downsize_format_if_needed takes an integer as number of uploads parameter. Hence, let's do an integer comparation instead of a boolean check, since that is confusing. Since we are at it, fix a couple of wrongly tabbed indents. Cc: Alejandro Piñeiro <[email protected]> Cc: Kenneth Graunke <[email protected]> Signed-off-by: Andres Gomez <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/genX_state_upload.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c b/src/mesa/drivers/dri/i965/genX_state_upload.c
index a39a254dacd..45636fe69df 100644
--- a/src/mesa/drivers/dri/i965/genX_state_upload.c
+++ b/src/mesa/drivers/dri/i965/genX_state_upload.c
@@ -365,7 +365,7 @@ is_passthru_format(uint32_t format)
UNUSED static int
uploads_needed(uint32_t format,
- bool is_dual_slot)
+ bool is_dual_slot)
{
if (!is_passthru_format(format))
return 1;
@@ -409,14 +409,14 @@ downsize_format_if_needed(uint32_t format,
*/
switch (format) {
case ISL_FORMAT_R64_PASSTHRU:
- return !upload ? ISL_FORMAT_R32G32_FLOAT
- : ISL_FORMAT_R32_FLOAT;
+ return upload == 0 ? ISL_FORMAT_R32G32_FLOAT
+ : ISL_FORMAT_R32_FLOAT;
case ISL_FORMAT_R64G64_PASSTHRU:
- return !upload ? ISL_FORMAT_R32G32B32A32_FLOAT
- : ISL_FORMAT_R32_FLOAT;
+ return upload == 0 ? ISL_FORMAT_R32G32B32A32_FLOAT
+ : ISL_FORMAT_R32_FLOAT;
case ISL_FORMAT_R64G64B64_PASSTHRU:
- return !upload ? ISL_FORMAT_R32G32B32A32_FLOAT
- : ISL_FORMAT_R32G32_FLOAT;
+ return upload == 0 ? ISL_FORMAT_R32G32B32A32_FLOAT
+ : ISL_FORMAT_R32G32_FLOAT;
case ISL_FORMAT_R64G64B64A64_PASSTHRU:
return ISL_FORMAT_R32G32B32A32_FLOAT;
default:
@@ -635,7 +635,7 @@ genX(emit_vertices)(struct brw_context *brw)
uint32_t comp2 = VFCOMP_STORE_SRC;
uint32_t comp3 = VFCOMP_STORE_SRC;
const unsigned num_uploads = GEN_GEN < 8 ?
- uploads_needed(format, input->is_dual_slot) : 1;
+ uploads_needed(format, input->is_dual_slot) : 1;
#if GEN_GEN >= 8
/* From the BDW PRM, Volume 2d, page 588 (VERTEX_ELEMENT_STATE):