mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
nouveau: fix undefined behaviour when testing sample_count
NOTE: This is a candidate for the 9.0 branch.
This commit is contained in:
parent
b0863c26d4
commit
7d2d450ea6
3 changed files with 6 additions and 0 deletions
|
|
@ -244,6 +244,8 @@ nv30_screen_is_format_supported(struct pipe_screen *pscreen,
|
|||
unsigned sample_count,
|
||||
unsigned bindings)
|
||||
{
|
||||
if (sample_count > 4)
|
||||
return FALSE;
|
||||
if (!(0x00000017 & (1 << sample_count)))
|
||||
return FALSE;
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,8 @@ nv50_screen_is_format_supported(struct pipe_screen *pscreen,
|
|||
unsigned sample_count,
|
||||
unsigned bindings)
|
||||
{
|
||||
if (sample_count > 8)
|
||||
return FALSE;
|
||||
if (!(0x117 & (1 << sample_count))) /* 0, 1, 2, 4 or 8 */
|
||||
return FALSE;
|
||||
if (sample_count == 8 && util_format_get_blocksizebits(format) >= 128)
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@ nvc0_screen_is_format_supported(struct pipe_screen *pscreen,
|
|||
unsigned sample_count,
|
||||
unsigned bindings)
|
||||
{
|
||||
if (sample_count > 8)
|
||||
return FALSE;
|
||||
if (!(0x117 & (1 << sample_count))) /* 0, 1, 2, 4 or 8 */
|
||||
return FALSE;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue