else
if (pool == gcvPOOL_CONTIGUOUS)
{
- /* Create a gcuVIDMEM_NODE for contiguous memory. */
- status = gckVIDMEM_ConstructVirtual(Kernel, gcvTRUE, Bytes, &node);
+#if gcdCONTIGUOUS_SIZE_LIMIT
+ if (Bytes > gcdCONTIGUOUS_SIZE_LIMIT)
+ {
+ status = gcvSTATUS_OUT_OF_MEMORY;
+ }
+ else
+#endif
+ {
+ /* Create a gcuVIDMEM_NODE from contiguous memory. */
+ status = gckVIDMEM_ConstructVirtual(Kernel, gcvTRUE, Bytes, &node);
+ }
+
if (gcmIS_SUCCESS(status))
{
/* Memory allocated. */
# define gcdRATIO_FOR_SMALL_MEMORY 32
#endif
+/*
+ gcdCONTIGUOUS_SIZE_LIMIT
+ When non-zero, size of video node from gcvPOOL_CONTIGUOUS is
+ limited by gcdCONTIGUOUS_SIZE_LIMIT.
+ */
+#ifndef gcdCONTIGUOUS_SIZE_LIMIT
+# define gcdCONTIGUOUS_SIZE_LIMIT 4096
+#endif
/* gcdALPHA_KILL_IN_SHADER
*