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 <imirkin@alum.mit.edu> Reviewed-by: Rob Clark <robdclark@gmail.com>
This commit is contained in:
@@ -1306,11 +1306,16 @@ get_num_components_for_glformat(GLuint format)
|
|||||||
case GL_RGB10_A2:
|
case GL_RGB10_A2:
|
||||||
return 4;
|
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:
|
default:
|
||||||
/* Return 4 components also for all other formats we don't know
|
/* Return 4 components also for all other formats we don't know
|
||||||
* about. This is always safe. Also, the format should have been
|
* about. The format should have been validated already by
|
||||||
* validated already by the higher level API. Drop a debug message
|
* the higher level API, but drop a debug message just in case.
|
||||||
* just in case.
|
|
||||||
*/
|
*/
|
||||||
debug_printf("Unhandled GL format %u while emitting imageStore()\n",
|
debug_printf("Unhandled GL format %u while emitting imageStore()\n",
|
||||||
format);
|
format);
|
||||||
|
Reference in New Issue
Block a user