diff options
author | Eduardo Lima Mitev <[email protected]> | 2018-12-19 09:18:04 +0100 |
---|---|---|
committer | Eduardo Lima Mitev <[email protected]> | 2018-12-19 22:49:05 +0100 |
commit | c2ebc380524263df5447d9cee646f0024caea6f4 (patch) | |
tree | ccfa8a520c2d779773dd7904921791916dd269e5 /src/freedreno/ir3 | |
parent | 90818558f0e8e50cd20f637775f072b5511edfd0 (diff) |
freedreno/ir3: Handle GL_NONE in get_num_components_for_glformat()
An earlier patch that introduced the function failed to handle the case
where an image format layout qualifier is not specified, which is allowed
on desktop GL profiles. In these cases, nir_variable's image format is
GL_NONE, and we don't need to print a debug message for those.
Reviewed-by: Ilia Mirkin <[email protected]>
Reviewed-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/freedreno/ir3')
-rw-r--r-- | src/freedreno/ir3/ir3_compiler_nir.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/freedreno/ir3/ir3_compiler_nir.c b/src/freedreno/ir3/ir3_compiler_nir.c index 19aef3eb27e..936c3277fff 100644 --- a/src/freedreno/ir3/ir3_compiler_nir.c +++ b/src/freedreno/ir3/ir3_compiler_nir.c @@ -1306,11 +1306,16 @@ get_num_components_for_glformat(GLuint format) case GL_RGB10_A2: return 4; + case GL_NONE: + /* Omitting the image format qualifier is allowed on desktop GL + * profiles. Assuming 4 components is always safe. + */ + return 4; + default: /* Return 4 components also for all other formats we don't know - * about. This is always safe. Also, the format should have been - * validated already by the higher level API. Drop a debug message - * just in case. + * about. The format should have been validated already by + * the higher level API, but drop a debug message just in case. */ debug_printf("Unhandled GL format %u while emitting imageStore()\n", format); |