summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2020-08-26 06:03:18 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2020-08-26 06:03:18 +0000
commitaf5e8f5366b05c3d4f8521f318c143a5c5dc3ea9 (patch)
treec5691445908b1beca9facf0e5e3c5d7f35f74228 /lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
parent27c93456b58343162f7c4ad20ca6bea0c9a91646 (diff)
Merge Mesa 20.1.6
Diffstat (limited to 'lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c')
-rw-r--r--lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c59
1 files changed, 43 insertions, 16 deletions
diff --git a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
index b1e12432e..7abbf762a 100644
--- a/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
+++ b/lib/mesa/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
@@ -23,8 +23,8 @@
#include <xf86drm.h>
#include <nouveau_drm.h>
#include <nvif/class.h>
-#include "util/u_format.h"
-#include "util/u_format_s3tc.h"
+#include "util/format/u_format.h"
+#include "util/format/u_format_s3tc.h"
#include "util/u_screen.h"
#include "pipe/p_screen.h"
#include "compiler/nir/nir.h"
@@ -75,14 +75,12 @@ nvc0_screen_is_format_supported(struct pipe_screen *pscreen,
sample_count > 1)
return false;
- /* Restrict ETC2 and ASTC formats here. These are only supported on GK20A.
+ /* Restrict ETC2 and ASTC formats here. These are only supported on GK20A
+ * and GM20B.
*/
if ((desc->layout == UTIL_FORMAT_LAYOUT_ETC ||
desc->layout == UTIL_FORMAT_LAYOUT_ASTC) &&
- /* The claim is that this should work on GM107 but it doesn't. Need to
- * test further and figure out if it's a nouveau issue or a HW one.
- nouveau_screen(pscreen)->class_3d < GM107_3D_CLASS &&
- */
+ nouveau_screen(pscreen)->device->chipset != 0x12b &&
nouveau_screen(pscreen)->class_3d != NVEA_3D_CLASS)
return false;
@@ -192,11 +190,16 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
* COLOR, etc. here.
*/
return 0x1f0 / 16;
+ case PIPE_CAP_MAX_VERTEX_BUFFERS:
+ return 16;
+ case PIPE_CAP_GL_BEGIN_END_BUFFER_SIZE:
+ return 512 * 1024; /* TODO: Investigate tuning this */
/* supported caps */
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
case PIPE_CAP_TEXTURE_MIRROR_CLAMP_TO_EDGE:
case PIPE_CAP_TEXTURE_SWIZZLE:
+ case PIPE_CAP_TEXTURE_SHADOW_MAP:
case PIPE_CAP_NPOT_TEXTURES:
case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
case PIPE_CAP_MIXED_COLOR_DEPTH_BITS:
@@ -281,6 +284,17 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_DEST_SURFACE_SRGB_CONTROL:
case PIPE_CAP_TGSI_DIV:
case PIPE_CAP_TGSI_ATOMINC_WRAP:
+ case PIPE_CAP_DEMOTE_TO_HELPER_INVOCATION:
+ case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
+ case PIPE_CAP_PREFER_IMM_ARRAYS_AS_CONSTBUF:
+ case PIPE_CAP_FLATSHADE:
+ case PIPE_CAP_ALPHA_TEST:
+ case PIPE_CAP_POINT_SIZE_FIXED:
+ case PIPE_CAP_TWO_SIDED_COLOR:
+ case PIPE_CAP_CLIP_PLANES:
+ case PIPE_CAP_TEXTURE_SHADOW_LOD:
+ case PIPE_CAP_PACKED_STREAM_OUTPUT:
+ case PIPE_CAP_DRAW_INFO_START_WITH_USER_INDICES:
return 1;
case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
return nouveau_screen(pscreen)->vram_domain & NOUVEAU_BO_VRAM ? 1 : 0;
@@ -301,6 +315,8 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_CONSERVATIVE_RASTER_POST_SNAP_POINTS_LINES:
case PIPE_CAP_CONSERVATIVE_RASTER_POST_DEPTH_COVERAGE:
case PIPE_CAP_PROGRAMMABLE_SAMPLE_LOCATIONS:
+ case PIPE_CAP_VIEWPORT_SWIZZLE:
+ case PIPE_CAP_VIEWPORT_MASK:
return class_3d >= GM200_3D_CLASS;
case PIPE_CAP_CONSERVATIVE_RASTER_PRE_SNAP_TRIANGLES:
return class_3d >= GP100_3D_CLASS;
@@ -322,8 +338,8 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_TGSI_VS_WINDOW_SPACE_POSITION:
case PIPE_CAP_VERTEXID_NOBASE:
case PIPE_CAP_RESOURCE_FROM_USER_MEMORY:
- case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
case PIPE_CAP_TGSI_FS_POSITION_IS_SYSVAL:
+ case PIPE_CAP_TGSI_FS_POINT_IS_SYSVAL:
case PIPE_CAP_GENERATE_MIPMAP:
case PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY:
case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
@@ -365,6 +381,14 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_CS_DERIVED_SYSTEM_VALUES_SUPPORTED:
case PIPE_CAP_FBFETCH_COHERENT:
case PIPE_CAP_TGSI_SKIP_SHRINK_IO_ARRAYS:
+ case PIPE_CAP_TGSI_TG4_COMPONENT_IN_SWIZZLE:
+ case PIPE_CAP_OPENCL_INTEGER_FUNCTIONS: /* could be done */
+ case PIPE_CAP_INTEGER_MULTIPLY_32X16: /* could be done */
+ case PIPE_CAP_FRONTEND_NOOP:
+ case PIPE_CAP_GL_SPIRV:
+ case PIPE_CAP_SHADER_SAMPLES_IDENTICAL:
+ case PIPE_CAP_VIEWPORT_TRANSFORM_LOWERED:
+ case PIPE_CAP_PSIZ_CLAMPED:
return 0;
case PIPE_CAP_VENDOR_ID:
@@ -390,7 +414,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
/* caps where we want the default value */
case PIPE_CAP_DMABUF:
case PIPE_CAP_ESSL_FEATURE_LEVEL:
- case PIPE_CAP_MAX_FRAMES_IN_FLIGHT:
+ case PIPE_CAP_THROTTLE:
return u_pipe_screen_get_param_defaults(pscreen, param);
}
}
@@ -418,9 +442,13 @@ nvc0_screen_get_shader_param(struct pipe_screen *pscreen,
switch (param) {
case PIPE_SHADER_CAP_PREFERRED_IR:
return screen->prefer_nir ? PIPE_SHADER_IR_NIR : PIPE_SHADER_IR_TGSI;
- case PIPE_SHADER_CAP_SUPPORTED_IRS:
- return 1 << PIPE_SHADER_IR_TGSI |
- 1 << PIPE_SHADER_IR_NIR;
+ case PIPE_SHADER_CAP_SUPPORTED_IRS: {
+ uint32_t irs = 1 << PIPE_SHADER_IR_TGSI |
+ 1 << PIPE_SHADER_IR_NIR;
+ if (screen->force_enable_cl)
+ irs |= 1 << PIPE_SHADER_IR_NIR_SERIALIZED;
+ return irs;
+ }
case PIPE_SHADER_CAP_MAX_INSTRUCTIONS:
case PIPE_SHADER_CAP_MAX_ALU_INSTRUCTIONS:
case PIPE_SHADER_CAP_MAX_TEX_INSTRUCTIONS:
@@ -467,8 +495,6 @@ nvc0_screen_get_shader_param(struct pipe_screen *pscreen,
case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS:
case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS:
return 0;
- case PIPE_SHADER_CAP_SCALAR_ISA:
- return 1;
case PIPE_SHADER_CAP_MAX_SHADER_BUFFERS:
return NVC0_MAX_BUFFERS;
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
@@ -935,7 +961,7 @@ static const nir_shader_compiler_options nir_options = {
.lower_usub_borrow = true, // TODO
.lower_mul_high = false,
.lower_negate = false,
- .lower_sub = false, // TODO
+ .lower_sub = true,
.lower_scmp = true, // TODO: not implemented yet
.lower_idiv = true,
.lower_isign = false, // TODO
@@ -969,8 +995,9 @@ static const nir_shader_compiler_options nir_options = {
.use_interpolated_input_intrinsics = true,
.lower_mul_2x32_64 = true, // TODO
.max_unroll_iterations = 32,
- .lower_int64_options = nir_lower_divmod64, // TODO
+ .lower_int64_options = nir_lower_ufind_msb64|nir_lower_divmod64, // TODO
.lower_doubles_options = nir_lower_dmod, // TODO
+ .lower_to_scalar = true,
};
static const void *